mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-06 19:24:56 +03:00
Use contextjson
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package option
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/sagernet/sing-box/common/humanize"
|
||||
"github.com/sagernet/sing-box/common/json"
|
||||
)
|
||||
|
||||
type DebugOptions struct {
|
||||
|
||||
@@ -114,7 +114,7 @@ func (h *Inbound) UnmarshalJSON(bytes []byte) error {
|
||||
}
|
||||
err = UnmarshallExcluded(bytes, (*_Inbound)(h), v)
|
||||
if err != nil {
|
||||
return E.Cause(err, "inbound options")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ func (h *Outbound) UnmarshalJSON(bytes []byte) error {
|
||||
}
|
||||
err = UnmarshallExcluded(bytes, (*_Outbound)(h), v)
|
||||
if err != nil {
|
||||
return E.Cause(err, "outbound options")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ func (r *Rule) UnmarshalJSON(bytes []byte) error {
|
||||
}
|
||||
err = UnmarshallExcluded(bytes, (*_Rule)(r), v)
|
||||
if err != nil {
|
||||
return E.Cause(err, "route rule")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ func (r *DNSRule) UnmarshalJSON(bytes []byte) error {
|
||||
}
|
||||
err = UnmarshallExcluded(bytes, (*_DNSRule)(r), v)
|
||||
if err != nil {
|
||||
return E.Cause(err, "dns route rule")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ func (r *RuleSet) UnmarshalJSON(bytes []byte) error {
|
||||
}
|
||||
err = UnmarshallExcluded(bytes, (*_RuleSet)(r), v)
|
||||
if err != nil {
|
||||
return E.Cause(err, "rule set")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -118,7 +118,7 @@ func (r *HeadlessRule) UnmarshalJSON(bytes []byte) error {
|
||||
}
|
||||
err = UnmarshallExcluded(bytes, (*_HeadlessRule)(r), v)
|
||||
if err != nil {
|
||||
return E.Cause(err, "route rule-set rule")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -209,7 +209,7 @@ func (r *PlainRuleSetCompat) UnmarshalJSON(bytes []byte) error {
|
||||
}
|
||||
err = UnmarshallExcluded(bytes, (*_PlainRuleSetCompat)(r), v)
|
||||
if err != nil {
|
||||
return E.Cause(err, "rule set")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ func (o *ACMEDNS01ChallengeOptions) UnmarshalJSON(bytes []byte) error {
|
||||
}
|
||||
err = UnmarshallExcluded(bytes, (*_ACMEDNS01ChallengeOptions)(o), v)
|
||||
if err != nil {
|
||||
return E.Cause(err, "DNS01 challenge options")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ func (o *V2RayTransportOptions) UnmarshalJSON(bytes []byte) error {
|
||||
}
|
||||
err = UnmarshallExcluded(bytes, (*_V2RayTransportOptions)(o), v)
|
||||
if err != nil {
|
||||
return E.Cause(err, "vmess transport options")
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user