api_test.go 277 B

123456789101112131415
  1. package api
  2. import (
  3. "fmt"
  4. "github.com/gogf/gf/v2/encoding/gjson"
  5. "testing"
  6. )
  7. func TestGetWeatherInfo(t *testing.T) {
  8. weatherInfo, err := GetWeatherInfo("上海", "SgqF9ZGBUj7R0dLAb")
  9. if err != nil {
  10. fmt.Println(err)
  11. }
  12. fmt.Println(gjson.New(weatherInfo).String())
  13. }