feat:完善项目信息
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user