diff --git a/lib/spack/spack/build_systems/go.py b/lib/spack/spack/build_systems/go.py index 95472642f68..a22d3922e82 100644 --- a/lib/spack/spack/build_systems/go.py +++ b/lib/spack/spack/build_systems/go.py @@ -72,7 +72,7 @@ def build_directory(self): def build_args(self): """Arguments for ``go build``.""" # Pass ldflags -s = --strip-all and -w = --no-warnings by default - return ["-ldflags", "-s -w", "-o", f"{self.pkg.name}"] + return ["-modcacherw", "-ldflags", "-s -w", "-o", f"{self.pkg.name}"] @property def check_args(self):