Skip to content

Instantly share code, notes, and snippets.

@pistarlabs
Created September 28, 2015 06:26
Show Gist options
  • Save pistarlabs/c70dc9595b88039e18e2 to your computer and use it in GitHub Desktop.
Save pistarlabs/c70dc9595b88039e18e2 to your computer and use it in GitHub Desktop.
// Get database host or return empty string if not exists
host := cfg.UString("database.host")
// Get database host or return default passed value if not exists
host := cfg.UString("database.host", "default")
// Get database host and error
host, err := cfg.String("database.host")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment