fix: word error
This commit is contained in:
parent
8bfee444fd
commit
bf815a310d
@ -72,12 +72,12 @@ func (xc *Config) ParseData(data []byte) (config.Configer, error) {
|
|||||||
|
|
||||||
v := d["config"]
|
v := d["config"]
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return nil, fmt.Errorf("xml parse should incluce in <config></config> tags")
|
return nil, fmt.Errorf("xml parse should include in <config></config> tags")
|
||||||
}
|
}
|
||||||
|
|
||||||
confVal, ok := v.(map[string]interface{})
|
confVal, ok := v.(map[string]interface{})
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("xml parse <config></config> tags should incluce sub tags")
|
return nil, fmt.Errorf("xml parse <config></config> tags should include sub tags")
|
||||||
}
|
}
|
||||||
|
|
||||||
x.data = config.ExpandValueEnvForMap(confVal)
|
x.data = config.ExpandValueEnvForMap(confVal)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import (
|
|||||||
|
|
||||||
func TestXML(t *testing.T) {
|
func TestXML(t *testing.T) {
|
||||||
var (
|
var (
|
||||||
// xml parse should incluce in <config></config> tags
|
// xml parse should include in <config></config> tags
|
||||||
xmlcontext = `<?xml version="1.0" encoding="UTF-8"?>
|
xmlcontext = `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<config>
|
<config>
|
||||||
<appname>beeapi</appname>
|
<appname>beeapi</appname>
|
||||||
@ -158,7 +158,7 @@ func TestXMLMissConfig(t *testing.T) {
|
|||||||
|
|
||||||
c := &Config{}
|
c := &Config{}
|
||||||
_, err := c.ParseData([]byte(xmlcontext1))
|
_, err := c.ParseData([]byte(xmlcontext1))
|
||||||
assert.Equal(t, "xml parse should incluce in <config></config> tags", err.Error())
|
assert.Equal(t, "xml parse should include in <config></config> tags", err.Error())
|
||||||
|
|
||||||
xmlcontext2 := `
|
xmlcontext2 := `
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
@ -166,7 +166,7 @@ func TestXMLMissConfig(t *testing.T) {
|
|||||||
`
|
`
|
||||||
|
|
||||||
_, err = c.ParseData([]byte(xmlcontext2))
|
_, err = c.ParseData([]byte(xmlcontext2))
|
||||||
assert.Equal(t, "xml parse <config></config> tags should incluce sub tags", err.Error())
|
assert.Equal(t, "xml parse <config></config> tags should include sub tags", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
type Section struct {
|
type Section struct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user