I am trying to add data to the map without prior assignment, if I had the usual map[string][]string variable map[string][]string I could do it like this -> make(map[string][]string) , but I have type -> type Header map[string][]string .
Here is the code:
func (h Header) Add(key, value string) error { h[key] = append(h[key], value) } Knocks out: panic: assignment to entry in nil map . How can I solve this problem?