package config type ListenConfig struct { Host string Port int } type Config struct { Listen ListenConfig } var conf *Config = DefaultConfig() func GetConfig() *Config { return conf } func DefaultConfig() *Config { return &Config{ Listen: ListenConfig{ Host: "0.0.0.0", Port: 8080, }, } }