Home > other >  Unable to parse the json right??
Unable to parse the json right??

Time:05-03

I'd like to parse the json
 {
"Inbounds" : [
{
"Port" : 1080,
"Protocol" : "socks",
"Sniffing" : {
"Enabled" : true,
"DestOverride" : [" HTTP ", "the TLS]
},
"Settings" : {
"Auth" : "noauth"
}
}
]
}


The code is the
 package main 
Import (
"FMT"
"IO/ioutil
""Encoding/json"
)
Type Set struct {
Auth string ` json: "Auth" `
}
Type Snif struct {
Enabled bool ` json: "Enabled" `
DestOverride [] string ` json: "DestOverride `
}
Type In struct {
The Port float64 ` json: "Port" `
Protocol string ` json: "Protocol" `
Sniffing Snif ` json: "Sniffing" `
Settings Set ` json: "Settings" `
}
Type Fuck struct {
Inbounds ` In json: "the Inbounds" `
}
Func main () {
Var sex Fuck
The data, _ :=ioutil ReadFile (" vmess_client. Json ")
Json. The Unmarshal (data, & amp; Sex)
FMT. Println (sex)
}

Why can't parse? Where is wrong? thank you
  • Related