naoina / toml

TOML parser and encoder library for Golang
MIT License
294 stars 50 forks source link

Cannot decode into map[K]*V #27

Closed anacrolix closed 7 years ago

anacrolix commented 8 years ago

I cannot decode into a map[K]*V, but can to a map[K]V.

type Config struct {
    Backends       map[string]*Backend
}

type Backend struct {
    Hosts  []string
    Addr   string
    Scheme string
    Verify *bool

    hc *http.Client
}

panic: reflect.Value.SetMapIndex: value of type main.Backend is not assignable to type *main.Backend