package config import ( "fmt" "io/ioutil" "net/http" "testing" ) type config struct { Redis string `json:"redis,omitempty"` Es string `json:"es,omitempty"` } func TestEnv(t *testing.T) { resp, err := http.Get("http://api-lark-test/user") b, _ := ioutil.ReadAll(resp.Body) t.Log(string(b)) env, err := GetEnv() if err != nil { fmt.Println(err) } fmt.Println(env) }