mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-02-02 06:48:14 -05:00
remove no need pointer
This commit is contained in:
parent
946e130997
commit
38081e14c2
13
conf/node.go
13
conf/node.go
@ -10,8 +10,8 @@ type NodeConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type rawNodeConfig struct {
|
type rawNodeConfig struct {
|
||||||
ApiRaw *json.RawMessage `json:"ApiConfig"`
|
ApiRaw json.RawMessage `json:"ApiConfig"`
|
||||||
OptRaw *json.RawMessage `json:"Options"`
|
OptRaw json.RawMessage `json:"Options"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ApiConfig struct {
|
type ApiConfig struct {
|
||||||
@ -29,8 +29,8 @@ func (n *NodeConfig) UnmarshalJSON(data []byte) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if r.ApiRaw != nil {
|
if len(r.ApiRaw) > 0 {
|
||||||
err = json.Unmarshal(*r.ApiRaw, &n.ApiConfig)
|
err = json.Unmarshal(r.ApiRaw, &n.ApiConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -44,9 +44,8 @@ func (n *NodeConfig) UnmarshalJSON(data []byte) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.OptRaw != nil {
|
if len(r.OptRaw) > 0 {
|
||||||
data = *r.OptRaw
|
err = json.Unmarshal(r.OptRaw, &n.Options)
|
||||||
err = json.Unmarshal(data, &n.Options)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user