Skip to content

Instantly share code, notes, and snippets.

@napicella
Created April 1, 2018 14:37
Show Gist options
  • Save napicella/b1ba05048a0b160dcdc6140edae28b68 to your computer and use it in GitHub Desktop.
Save napicella/b1ba05048a0b160dcdc6140edae28b68 to your computer and use it in GitHub Desktop.
Golang-patterns constants example
// Package constants shows a pattern to group constants together
package constants
// Endpoint contains the endpoint configuration
var Endpoint struct {
Hostname string
Port int
}
func init() {
Endpoint.Hostname = "some-endpoint"
Endpoint.Port = 9090
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment