Last active
December 26, 2015 06:39
-
-
Save hash/7109603 to your computer and use it in GitHub Desktop.
Go Package Management
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
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