Skip to content

Commit

Permalink
enable modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Downs authored and Brian Downs committed Oct 28, 2019
1 parent 81eda91 commit b4159c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ GOTEST = $(GOCMD) test

all: test

.PHONY: test
test:
$(GOTEST) -v -covermode=count -coverprofile=coverage.out ./...

.PHONY: build
build: test
$(GOBUILD)

.PHONY: install
install: test
$(GOINSTALL)
5 changes: 1 addition & 4 deletions current_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ func TestNewCurrent(t *testing.T) {
t.Error(err)
}

_, err = NewCurrent(d, "blah", os.Getenv("OWM_API_KEY"))
if err != nil {
if _, err := NewCurrent(d, "blah", os.Getenv("OWM_API_KEY")); err != nil {
t.Log("received expected bad language code error")
}

Expand All @@ -69,7 +68,6 @@ func TestNewCurrent(t *testing.T) {
// TestNewCurrentWithCustomHttpClient will verify that a new instance of CurrentWeatherData
// is created with custom http client
func TestNewCurrentWithCustomHttpClient(t *testing.T) {

hc := http.DefaultClient
hc.Timeout = time.Duration(1) * time.Second
c, err := NewCurrent("c", "en", os.Getenv("OWM_API_KEY"), WithHttpClient(hc))
Expand All @@ -90,7 +88,6 @@ func TestNewCurrentWithCustomHttpClient(t *testing.T) {
// TestNewCurrentWithInvalidOptions will verify that returns an error with
// invalid option
func TestNewCurrentWithInvalidOptions(t *testing.T) {

optionsPattern := [][]Option{
{nil},
{nil, nil},
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/briandowns/openweathermap

go 1.13

0 comments on commit b4159c0

Please sign in to comment.