mycommon/myconf/conf_test.go

26 lines
298 B
Go

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{}
LoadFile("test.yaml", config)
fmt.Printf("%+v\n", config)
}