Skip to content

Commit

Permalink
append newlines for toml config
Browse files Browse the repository at this point in the history
  • Loading branch information
UlricQin committed Sep 17, 2022
1 parent 06a2989 commit aa57d5b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/cfg/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func LoadConfigByDir(configDir string, configPtr interface{}) error {
}

if len(tBuf) != 0 {
tBuf = append(tBuf, []byte("\n\n")...)
loaders = append(loaders, &multiconfig.TOMLLoader{Reader: bytes.NewReader(tBuf)})
}
if len(yBuf) != 0 {
Expand Down Expand Up @@ -92,6 +93,7 @@ func LoadConfigs(configs []ConfigWithFormat, configPtr interface{}) error {
for _, c := range configs {
switch c.Format {
case TomlFormat:
tBuf = append(tBuf, []byte("\n\n")...)
tBuf = append(tBuf, []byte(c.Config)...)
case YamlFormat:
yBuf = append(yBuf, []byte(c.Config)...)
Expand Down

0 comments on commit aa57d5b

Please sign in to comment.