mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-22 02:33:49 +03:00
Improve configuration merge
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type _Options struct {
|
||||
RawMessage json.RawMessage `json:"-"`
|
||||
Schema string `json:"$schema,omitempty"`
|
||||
Log *LogOptions `json:"log,omitempty"`
|
||||
DNS *DNSOptions `json:"dns,omitempty"`
|
||||
@@ -26,6 +27,7 @@ func (o *Options) UnmarshalJSON(content []byte) error {
|
||||
decoder.DisallowUnknownFields()
|
||||
err := decoder.Decode((*_Options)(o))
|
||||
if err == nil {
|
||||
o.RawMessage = content
|
||||
return nil
|
||||
}
|
||||
if syntaxError, isSyntaxError := err.(*json.SyntaxError); isSyntaxError {
|
||||
|
||||
Reference in New Issue
Block a user