The go tool link command has a -X option (see go doc cmd/link):

   -X importpath.name=value
        Set the value of the string variable in importpath named name to value.
        This is only effective if the variable is declared in the
source code either uninitialized
        or initialized to a constant string expression. -X will not
work if the initializer makes
        a function call or refers to other variables.
        Note that before Go 1.5 this option took two separate arguments.

In a spec file using -linkmode=external is there an equivalent option
to -X above?

An upstream project uses -X in their makefile to set the Version
string to a value other than "unknown". One option that works for a
spec file is to just use sed to set the Version string to the desired
value but I was wondering if there was an equivalent linker flag that
can be used that will replicate -X above.

thanks

Brad
--
_______________________________________________
golang mailing list -- golang@lists.fedoraproject.org
To unsubscribe send an email to golang-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/golang@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to