Set build version and git revision using -ldflags

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.1.1, 3.4.19, 4.0.5, 3.6.10
    • Affects Version/s: None
    • Component/s: All Tools
    • None

      Currently we edit the variable in the source file using sed in the build.sh script. go allows you to set variables at link time using:

      go build -ldflags "-X {package}.{ConstName}={value}"
      

      We should adopt this pattern in our build.sh script to prevent changing the source code.

      Blog post describing this process.

            Assignee:
            David Golden
            Reporter:
            William Banfield (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: