package main import ( "fmt" "log" "os" "strconv" owm "github.com/briandowns/openweathermap" ) var apiKey string func init() { apiKey = os.Getenv("OWM_API_KEY") if apiKey == "" { log.Fatal("No API key") } } func main() { w, err := owm.NewCurrent("F", "en", apiKey) if err != nil { log.Fatalln(err) } err = w.CurrentByZip(97351, "us") if err != nil { log.Fatalln(err) } out := w.Weather[0].Description + " " + strconv.Itoa(int(w.Main.Temp)) + " °F" fmt.Println(out) }