feat:完善项目信息

This commit is contained in:
henry
2021-12-28 10:57:13 +08:00
parent 7eb8e5c48b
commit ae25321694
5 changed files with 59 additions and 90 deletions

View File

@ -6,9 +6,13 @@ import (
"testing"
)
type Mysql struct {
Host string
}
type config struct {
Version int
Mapping map[string]string
Version int `yaml:"version"`
Mapping *Mysql `yaml:"mapping"`
}
func TestNewFile(t *testing.T) {
@ -23,9 +27,8 @@ func TestNewFile(t *testing.T) {
err = enc.Encode(config{
Version: 7,
Mapping: map[string]string{
"key": "value1",
"key2": "value2",
Mapping: &Mysql{
Host: "123",
},
})
if err != nil {