Last active
November 19, 2017 13:09
-
-
Save xcoulon/501c3ae1a51046b92193b339dada695a to your computer and use it in GitHub Desktop.
Nested structs in Golang (resource for the story on Medium)
This file contains hidden or 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
type Config struct { | |
Server Server `json:"server"` | |
Postgres Postgres `json:"postgres"` | |
} | |
type Server struct { | |
Host string `json:"host"` | |
Port string `json:"port"` | |
} | |
type Postgres struct { | |
Host string `json:"host"` | |
User string `json:"user"` | |
Password string `json:"password"` | |
DB string `json:"db"` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment