diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 1bea34ff0f161..ceac979995011 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1837,12 +1837,16 @@ def std_configure_args(prefix: self.prefix, libdir: "lib") # Standard parameters for Go builds. sig { - params(output: T.any(String, Pathname), - ldflags: T.nilable(T.any(String, T::Array[String]))).returns(T::Array[String]) + params( + output: T.any(String, Pathname), + ldflags: T.nilable(T.any(String, T::Array[String])), + gcflags: T.nilable(T.any(String, T::Array[String])), + ).returns(T::Array[String]) } - def std_go_args(output: bin/name, ldflags: nil) + def std_go_args(output: bin/name, ldflags: nil, gcflags: nil) args = ["-trimpath", "-o=#{output}"] args += ["-ldflags=#{Array(ldflags).join(" ")}"] if ldflags + args += ["-gcflags=#{Array(gcflags).join(" ")}"] if gcflags args end