diff --git a/component/golang/buildout.cfg b/component/golang/buildout.cfg index 70d2e49ffa538890fd0268656b5810dd61bc2b17..d6d983adfbcbb636407437eba69296c02a0b0e7f 100644 --- a/component/golang/buildout.cfg +++ b/component/golang/buildout.cfg @@ -142,7 +142,7 @@ recipe = slapos.recipe.template url = ${:_profile_base_location_}/goenv.sh.in output = ${gowork:directory}/env.sh depends = ${gowork.mkdir:recipe} -md5sum = 09c229292b341da0de933f5900de7011 +md5sum = 6efdf5d63381c240c7d206d7939a63f7 [gowork.mkdir] # NOTE do not use slapos.cookbook:mkdirectory here - if anything in software (not instance) diff --git a/component/golang/goenv.sh.in b/component/golang/goenv.sh.in index fb763b7013d9643a65813d52d9cbe9a18d90f73d..ab53d99a9f738b1d644db9c30cc0463d1d9f94a7 100644 --- a/component/golang/goenv.sh.in +++ b/component/golang/goenv.sh.in @@ -10,11 +10,14 @@ export PKG_CONFIG_PATH=$(echo -n "${gowork:cpkgpath}" |tr '\n' ':'):$PKG_CONFIG_ # ---- 8< ---- export GOPATH=$X:$GOPATH -export PATH=$X/bin:$PATH -export PS1="(`basename $X`) $PS1" +export GOBIN=$X/bin export GOCACHE=$X/cache +export GOMODCACHE=$X/pkg/mod export GOENV=$X/goenv +export PATH=$GOBIN:$PATH +export PS1="(`basename $X`) $PS1" + # by default make go run in module-aware mode only if go.mod is present, and in GOPATH-mode otherwise. # (we still have some GOPATH uses; TODO -> default to "on" after GOPATH-mode usage is gone) export GO111MODULE=auto