Skip to content

Commit

Permalink
Add -gcflags to std_go_args
Browse files Browse the repository at this point in the history
  • Loading branch information
Neved4 committed Oct 23, 2024
1 parent 62c1f5b commit 219a937
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(

Check warning on line 1840 in Library/Homebrew/formula.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/formula.rb#L1840

Added line #L1840 was not covered by tests
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

Expand Down

0 comments on commit 219a937

Please sign in to comment.