diff --git a/component/golang/buildout.cfg b/component/golang/buildout.cfg
index 5153ffa9294ca6ef0f71fe09321e4a315ee457c4..4088ef304a6fd22dfdfc655ef5a157cbe1d017d1 100644
--- a/component/golang/buildout.cfg
+++ b/component/golang/buildout.cfg
@@ -19,11 +19,18 @@ shared = true
 configure-command = :
 location = @@LOCATION@@
 make-binary =
+make-targets =
+  cd src &&
+  unset GOBIN &&
 # build and test Go and its standard library
+  ./all.bash &&
 # clean intermediate cache before installing
 # contrary to build cache in gowork, build cache, that Go uses during its own build, is not reused anywhere:
 # https://github.com/golang/go/blob/go1.18.2-0-g8ed0e51b5e/src/cmd/dist/build.go#L239-L242
-make-targets= cd src && unset GOBIN && ./all.bash && GOCACHE=`pwd`/../pkg/obj/go-build ../bin/go clean -cache && cp -alf .. ${:location}
+  GOCACHE=`pwd`/../pkg/obj/go-build ../bin/go clean -cache &&
+# also clean the global cache, which is used during the tests.
+  ../bin/go clean -cache &&
+  cp -alf .. ${:location}
 # some testdata files have an issue with slapos.extension.strip.
 post-install = ${findutils:location}/bin/find ${:location}/src -type d -name testdata -exec rm -rf {} \; || true
 environment =