Skip to content

Instantly share code, notes, and snippets.

@hash
Last active December 26, 2015 06:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hash/7109603 to your computer and use it in GitHub Desktop.
Save hash/7109603 to your computer and use it in GitHub Desktop.
Go Package Management
Go Package Management
interface type version
type version interface {
string Version()
}
exported in a package
type Version string
func (v *Version) Version() {
return "I am version 1"
}
var (
Version = Version{}
)
better
import (
"versioning"
)
var (
Version versioning.Version("I am version 1")
)
version checked when importing or init
func init() {
versioning.DependOn("package/name","version")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment