fix(config): use proper var name for arguments

This commit is contained in:
hexxa 2022-02-09 13:50:11 +08:00 committed by Hexxa
parent 755c5703c1
commit 33a269d220
4 changed files with 24 additions and 24 deletions

View file

@ -12,30 +12,30 @@ import (
)
func TestLoadCfg(t *testing.T) {
argsList := []*Opts{
argsList := []*Args{
// default config
&Opts{
&Args{
Host: "",
Port: 0,
DbPath: "",
Configs: []string{},
},
// default config + config_1
&Opts{
&Args{
Host: "",
Port: 0,
DbPath: "",
Configs: []string{"testdata/config_1.yml"},
},
// default config + config_1 + config_4
&Opts{
&Args{
Host: "",
Port: 0,
DbPath: "",
Configs: []string{"testdata/config_1.yml", "testdata/config_4.yml"},
},
// config partial overwrite
&Opts{
&Args{
Host: "",
Port: 0,
DbPath: "",
@ -47,7 +47,7 @@ func TestLoadCfg(t *testing.T) {
},
},
// default config + config_1 + config_4 + db_partial + args(db)
&Opts{
&Args{
Host: "",
Port: 0,
DbPath: "testdata/test_quickshare.db",
@ -331,8 +331,8 @@ func TestLoadCfg(t *testing.T) {
}
testLoadCfg := func(t *testing.T) {
for i, opts := range argsList {
gotCfg, err := LoadCfg(opts)
for i, args := range argsList {
gotCfg, err := LoadCfg(args)
if err != nil {
t.Fatal(err)
}