I have the following code :
package main
import "fmt"
type config struct {
user string
pass string
B map[string]int
}
func main() {
conf := new(config)
conf.user = "florence"
conf.pass = "machine"
// trying to fill a map entry "x" where the value is 2 but the compiler throws an error
conf.B["x"]=2
fmt.Printf("%+v", conf)
}
which not compiling i am trying to add map where its key as string and value as numbers to struct as field but i am not able to access any help ?