Fix config parsing

remotes/1698823321490190475/tmp_refs/heads/update-golang
Jonas Franz 5 년 전 committed by Jonas Franz
부모 8f817ec4b3
커밋 ca9a16558e
  1. 4
      config/config.go
  2. 11
      config/config_test.go

@ -5,9 +5,9 @@ var Config = struct {
GitHub struct {
ClientID string `required:"true" yaml:"client_id"`
ClientSecret string `required:"true" yaml:"client_secret"`
}
} `yaml:"GitHub"`
Web struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
}
} `yaml:"Web"`
}{}

@ -0,0 +1,11 @@
package config
import (
"github.com/jinzhu/configor"
"github.com/stretchr/testify/assert"
"testing"
)
func TestReadConfig(t *testing.T) {
assert.NoError(t, configor.New(&configor.Config{ErrorOnUnmatchedKeys: true}).Load(&Config, "../config.example.yml"), "Parse example config failed.")
}
불러오는 중...
취소
저장