backend/pkg/config/config_test.go

37 lines
552 B
Go
Raw Normal View History

2022-01-11 00:48:03 +08:00
package config
import (
"fmt"
"testing"
)
type config struct {
Redis string `json:"redis,omitempty"`
Es string `json:"es,omitempty"`
}
func TestGetMysql(t *testing.T) {
//获取 /config/mysql/api-zeus 的str
mysql, err := GetMysql("api-zeus")
if err != nil {
fmt.Println(err)
}
fmt.Println(mysql)
}
func TestConfig(t *testing.T) {
c := new(config)
err := GetConfig("api-zeus", c)
if err != nil {
fmt.Println(err)
}
}
func TestEnv(t *testing.T) {
env, err := GetEnv()
if err != nil {
fmt.Println(err)
}
fmt.Println(env)
}