Joined September 2013
·

Jamu Kakar

Vancouver, Canada
·
·
·

Thanks for this, it was helpful. There's a subtle bug here which is that values that contain an = sign are not properly handled. You need to change the getkeyval function to:

splits := strings.Split(item, "=")
key = splits[0]
val = strings.Join(splits[1:], "=")
return

Without this fix an environment variable created with export VALUE=some=value will end up as some in the resulting map.

Achievements
69 Karma
0 Total ProTip Views
Interests & Skills