Skip to content

Commit

Permalink
Fix import cycle and build error
Browse files Browse the repository at this point in the history
Importing the current package from it's external source creates an import cycle; changing the package name for this test breaks the cycle. Also, "err := nil" is ambiguous and causes a compile-time failure.
  • Loading branch information
logic committed Mar 4, 2017
1 parent d0e59c2 commit 1ad4f4d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions example_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package hostpool
package hostpool_test

import (
"github.com/bitly/go-hostpool"
Expand All @@ -7,7 +7,6 @@ import (
func ExampleNewEpsilonGreedy() {
hp := hostpool.NewEpsilonGreedy([]string{"a", "b"}, 0, &hostpool.LinearEpsilonValueCalculator{})
hostResponse := hp.Get()
hostname := hostResponse.Host()
err := nil // (make a request with hostname)
hostResponse.Mark(err)
_ = hostResponse.Host()
hostResponse.Mark(nil)
}

0 comments on commit 1ad4f4d

Please sign in to comment.