Skip to content

Instantly share code, notes, and snippets.

@duglin
Last active November 26, 2015 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duglin/cca989a48fff40555265 to your computer and use it in GitHub Desktop.
Save duglin/cca989a48fff40555265 to your computer and use it in GitHub Desktop.
package api
...
func ResolveVersion() string {
version := "1.21"
if tmp := os.Getenv("DOCKER_API_VERSION"); tmp != "" {
version = tmp
}
return tmp
}
Then any current uses of:
api.Version
become:
api.ResolveVersion()
or rename to:
api.Version()
if that's less confusing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment