From 329dc35399b556a68b719023bf45c02658c3f387 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 4 Jan 2018 22:49:06 +0100 Subject: [PATCH] switching to symlinked folder On activate it might be useful to `cd` to `$GOPATH/src/` folder and switch back on deactivation. It will make it possible to use for example `dep` tool. --- init.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.go b/init.go index c9363b9..8eb061d 100644 --- a/init.go +++ b/init.go @@ -31,6 +31,7 @@ export PS1="($(basename $GOPATH))$PS1" mkdir -p $(dirname $GOPATH/src/{{.ImportPath}}) rm -f $GOPATH/src/{{.ImportPath}} ln -s {{.ProjectPath}} $GOPATH/src/{{.ImportPath}} +cd $GOPATH/src/{{.ImportPath}} deactivate() { export PS1=$GOENV_OLDPS1 @@ -39,6 +40,7 @@ deactivate() { unset GOENV GOENV_OLDPS1 GOENV_OLDPATH GOENV_OLDGOPATH unset -f deactivate + cd {{.ProjectPath}} } `