Skip to content

Commit

Permalink
Merge pull request #62 from davidprogers/fix_examples
Browse files Browse the repository at this point in the history
 Add API Key query to examples
  • Loading branch information
briandowns authored Dec 17, 2017
2 parents cd40270 + e6a3575 commit 722564b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _examples/cli/weather.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func getLocation() *Data {
// getCurrent gets the current weather for the provided
// location in the units provided.
func getCurrent(l, u, lang string) *owm.CurrentWeatherData {
w, err := owm.NewCurrent(u, lang)
w, err := owm.NewCurrent(u, lang, os.Getenv("OWM_API_KEY"))
if err != nil {
log.Fatalln(err)
}
Expand Down
3 changes: 2 additions & 1 deletion _examples/web/weatherweb.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
// "io/ioutil"
"log"
"net/http"
"os"
)

// URL is a constant that contains where to find the IP locale info
Expand Down Expand Up @@ -59,7 +60,7 @@ func getLocation() (*Data, error) {
// getCurrent gets the current weather for the provided location in
// the units provided.
func getCurrent(l, u, lang string) *owm.CurrentWeatherData {
w, err := owm.NewCurrent(u, lang) // Create the instance with the given unit
w, err := owm.NewCurrent(u, lang, os.Getenv("OWM_API_KEY")) // Create the instance with the given unit
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 722564b

Please sign in to comment.