make+build: compile build tags into binary

This commit is contained in:
Conner Fromknecht committed 2020-04-10 16:39:23 -07:00
1 parent 75a1a1fbab
commit 07420835d0
2 files changed
+25 -6

No files matched your search

+13
View File
@@ -20,6 +20,10 @@ var (
// CommitHash stores the current commit hash of this build, this should
// be set using the -ldflags during compilation.
CommitHash string
// RawTags contains the raw set of build tags, separated by commas. This
// should be set using -ldflags during compilation.
RawTags string
)
// semanticAlphabet is the set of characters that are permitted for use in an
@@ -74,3 +78,12 @@ func Version() string {
return version
}
// Tags returns the list of build tags that were compiled into the executable.
func Tags() []string {
if len(RawTags) == 0 {
return nil
}
return strings.Split(RawTags, ",")
}