These are chat archives for nelsam/vidar

13th
Oct 2016
Samuel Nelson
@nelsam
Oct 13 2016 06:43
This message was deleted
This message was deleted
Samuel Nelson
@nelsam
Oct 13 2016 06:50
func (p Project) Environ() []string {
    environ := os.Environ()
    if p.Gopath == "" {
        return environ
    }
    environ = addEnv(environ, "GOPATH", p.Gopath, true)
    return addEnv(environ, "PATH", filepath.Join(p.Gopath, "bin"), false)
}

func addEnv(environ []string, key, value string, replace bool) []string {
    envKey := key + "="
    env := envKey + value
    for i, v := range environ {
        if !strings.HasPrefix(v, envKey) {
            continue
        }
        if !replace {
            env = fmt.Sprintf("%s%c%s", v, os.FileListSeparator, value)
        }
        environ[i] = env
        return environ
    }
    return append(environ, env)
}
^ try that instead, when you have a chance
my hope is that it will work equally well on linux/osx/bsd/windows
with that, the gocode provider should use the project's Environ() method instead of os.Environ()