Skip to content

tty47/gover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoVer

Is a repository that contains differents ways to build your Go app and set the version on it.


Const

Splitted in different files in which you will define the variable values.

Non prod build:

main_dev.go

// +build !prod

// Package name -> P.E
package main

// const which you will set with that value -> P.E
const version = "development"

main_prod.go

//  +build prod

// Package name -> P.E
package main

// const which you will set with that value -> P.E
const version = "production"

Vars

Build go with tags for NON pro

go build

Build go with tags for pro

go build -tags prod

Ldflags

Build go with git commit id:

go build -ldflags "-X main.version=$(git rev-parse HEAD)"

About

GoVer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages