package config import ( "os" "path" "testing" ) func TestLoad(t *testing.T) { type args struct { p []string } wd, err := os.Getwd() if err != nil { t.Errorf("Get WD error = %v", err) } fp := path.Join(wd, "..", "..", "config", "config.yml") tests := []struct { name string args args wantErr bool }{ { name: "test load config", args: args{p: []string{fp}}, wantErr: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if err := Load(tt.args.p...); (err != nil) != tt.wantErr { t.Errorf("Load() error = %v, wantErr %v", err, tt.wantErr) } }) } }