Should we change the type of environment variables in Go 2?
Currently it's []string which is slightly odd. We at least solved the duplicated problems in Go 1.9 with https://golang.org/doc/go1.9#os/exec (#12868).
In #25210 (comment), @alexbrainman suggested map[string]string but that doesn't work well for case-insensitive Windows, and doesn't permit intentional(ly odd) duplicates or specific ordering on Unix, if such control is ever desired. (whether we wish to permit that is an additional question)
It might be nice to have some new opaque type (not exposing the underlying representation) and have various constructors and accessors.
Should we change the type of environment variables in Go 2?
Currently it's
[]stringwhich is slightly odd. We at least solved the duplicated problems in Go 1.9 with https://golang.org/doc/go1.9#os/exec (#12868).In #25210 (comment), @alexbrainman suggested
map[string]stringbut that doesn't work well for case-insensitive Windows, and doesn't permit intentional(ly odd) duplicates or specific ordering on Unix, if such control is ever desired. (whether we wish to permit that is an additional question)It might be nice to have some new opaque type (not exposing the underlying representation) and have various constructors and accessors.