Skip to content

Commit 6867043

Browse files
authored
Use conventional Go style for exported variables (#45)
1 parent 3315105 commit 6867043

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ func main() {
5555
app.Name = "my-app"
5656
app.Author = "Gruntwork <www.gruntwork.io>"
5757

58-
// Set the version number from your app from the VERSION variable that is passed in at build time in `version` package
58+
// Set the version number from your app from the Version variable that is passed in at build time in `version` package
5959
// for more understanding see github.com/gruntwork-io/go-commons/version
60-
app.Version = version.Version()
60+
app.Version = version.GetVersion()
6161

6262
app.Action = func(cliContext *cli.Context) error {
6363
// ( fill in your app details)

version/version.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ package version
33
// This variable is set at build time using -ldflags parameters. For example, we typically set this flag in circle.yml
44
// to the latest Git tag when building our Go apps:
55
//
6-
// build-go-binaries --app-name my-app --dest-path bin --ld-flags "-X github.com/gruntwork-io/go-commons/version.VERSION=$CIRCLE_TAG"
7-
// go build -o my-app -ldflags "-X github.com/gruntwork-io/go-commons/version.VERSION=v1.0.0"
6+
// build-go-binaries --app-name my-app --dest-path bin --ld-flags "-X github.com/gruntwork-io/go-commons/version.Version=$CIRCLE_TAG"
7+
// go build -o my-app -ldflags "-X github.com/gruntwork-io/go-commons/version.Version=v1.0.0"
88
//
99
// For more info, see: http://stackoverflow.com/a/11355611/483528
1010

1111
var (
12-
VERSION = "latest"
12+
Version = "latest"
1313
)
1414

1515
// Version composes a version of the package
16-
func Version() string {
17-
return VERSION
16+
func GetVersion() string {
17+
return Version
1818
}

0 commit comments

Comments
 (0)