-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print dh-make-golang version at the start of make
Set to v0.3.3 release
- Loading branch information
1 parent
21ce8b5
commit c43abd7
Showing
3 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"runtime" | ||
) | ||
|
||
// Version represents the dh-make-golang build version. | ||
type Version struct { | ||
major int | ||
minor int | ||
patch int | ||
preRelease string | ||
} | ||
|
||
var currentVersion = Version{ | ||
major: 0, | ||
minor: 3, | ||
patch: 3, | ||
preRelease: "", | ||
} | ||
|
||
func (v Version) String() string { | ||
return fmt.Sprintf("%d.%d.%d%s", v.major, v.minor, v.patch, v.preRelease) | ||
} | ||
|
||
func buildVersionString() string { | ||
version := "v" + currentVersion.String() | ||
osArch := runtime.GOOS + "/" + runtime.GOARCH | ||
return fmt.Sprintf("%s %s %s", program, version, osArch) | ||
} |