package myconf import ( "fmt" "testing" ) func TestConf(t *testing.T) { type Config struct { App struct { Name string Addr string Port int } Redis struct { Addr string Db int } } var config = &Config{} Init("test.yaml", config) fmt.Printf("%+v\n", config) }