I cannot figure out how to initialize
a nested struct. Find an example here:
href="http://play.golang.org/p/NL6VXdHrjh">http://play.golang.org/p/NL6VXdHrjh
package
main
type Configuration struct {
Val
string
Proxy struct {
Address string
Port
string
}
}
func main()
{
c := &Configuration{
Val:
"test",
Proxy: {
Address: "addr",
Port:
"80",
},
}
}
No comments:
Post a Comment