chore: fix deprecated usages (#1871)

* add conf documents

* chore: use {} instead of () for environment variables

* chore: fix deprecated usages

* chore: fix unstable tests

* chore: show stack on github actions
This commit is contained in:
Kevin Wan
2022-05-06 15:13:46 +08:00
committed by GitHub
parent 469e62067c
commit d0a59b13a6
4 changed files with 11 additions and 16 deletions

View File

@@ -21,7 +21,7 @@ Name: foo
Port: 54321
`
var cnf RestConf
assert.Nil(t, conf.LoadConfigFromYamlBytes([]byte(configYaml), &cnf))
assert.Nil(t, conf.LoadFromYamlBytes([]byte(configYaml), &cnf))
tests := []struct {
c RestConf
@@ -271,7 +271,7 @@ Name: foo
Port: 54321
`
var cnf RestConf
assert.Nil(t, conf.LoadConfigFromYamlBytes([]byte(configYaml), &cnf))
assert.Nil(t, conf.LoadFromYamlBytes([]byte(configYaml), &cnf))
testConfig := &tls.Config{
CipherSuites: []uint16{
@@ -309,7 +309,7 @@ Name: foo
Port: 54321
`
var cnf RestConf
assert.Nil(t, conf.LoadConfigFromYamlBytes([]byte(configYaml), &cnf))
assert.Nil(t, conf.LoadFromYamlBytes([]byte(configYaml), &cnf))
rt := router.NewRouter()
svr, err := NewServer(cnf, WithRouter(rt))
assert.Nil(t, err)
@@ -324,7 +324,7 @@ Name: foo
Port: 54321
`
var cnf RestConf
assert.Nil(t, conf.LoadConfigFromYamlBytes([]byte(configYaml), &cnf))
assert.Nil(t, conf.LoadFromYamlBytes([]byte(configYaml), &cnf))
rt := router.NewRouter()
svr, err := NewServer(cnf, WithRouter(rt))
assert.Nil(t, err)