Repro: https://github.com/davidwallacejackson/go-path-repro
I think this issue happens because $GOROOT/bin has already been added to PATH somehow before these injected rc lines are run. Because the default GOROOT is /usr/local/go, the path to its bindirectory is/usr/local/go/bin, which contains /go/bin-- which then causes the match"${GOPATH}/bin"to pass erroneously (since/go/bincan be found in thePATH` string). This might be fixable just by using a regex for the match instead.
This is another example of something that would be solved by #155
Repro: https://github.com/davidwallacejackson/go-path-repro
I think this issue happens because
$GOROOT/binhas already been added toPATHsomehow before these injected rc lines are run. Because the defaultGOROOTis /usr/local/go, the path to itsbindirectory is/usr/local/go/bin, which contains/go/bin-- which then causes the match"${GOPATH}/bin"to pass erroneously (since/go/bincan be found in thePATH` string). This might be fixable just by using a regex for the match instead.This is another example of something that would be solved by #155