未验证 提交 97bc3208 编辑于 作者: Caleb Xu's avatar Caleb Xu
浏览文件

std_go_args: accept ldflags as string or Array(string)

上级 3f357861
......@@ -1528,10 +1528,13 @@ class Formula
end
# Standard parameters for Go builds.
sig { params(output: T.any(String, Pathname), ldflags: T.nilable(String)).returns(T::Array[String]) }
sig {
params(output: T.any(String, Pathname),
ldflags: T.nilable(T.any(String, T::Array[String]))).returns(T::Array[String])
}
def std_go_args(output: bin/name, ldflags: nil)
args = ["-trimpath", "-o=#{output}"]
args += ["-ldflags=#{ldflags}"] if ldflags
args += ["-ldflags=#{Array(ldflags).join(" ")}"] if ldflags
args
end
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册