package api import ( "fmt" "github.com/gogf/gf/v2/encoding/gjson" "testing" ) func TestGetWeatherInfo(t *testing.T) { weatherInfo, err := GetWeatherInfo("上海", "SgqF9ZGBUj7R0dLAb") if err != nil { fmt.Println(err) } fmt.Println(gjson.New(weatherInfo).String()) }