diff --git a/http_example_test.go b/http_example_test.go index 82e9c50..f3e72c8 100644 --- a/http_example_test.go +++ b/http_example_test.go @@ -7,8 +7,6 @@ import ( "bytes" "crypto/rsa" "fmt" - "github.com/dgrijalva/jwt-go" - "github.com/dgrijalva/jwt-go/request" "io" "io/ioutil" "log" @@ -17,6 +15,9 @@ import ( "net/url" "strings" "time" + + "github.com/dgrijalva/jwt-go" + "github.com/dgrijalva/jwt-go/request" ) // location of the files used for signing and verification @@ -55,6 +56,7 @@ func init() { // Setup listener listener, err := net.ListenTCP("tcp", &net.TCPAddr{}) + fatal(err) serverPort = listener.Addr().(*net.TCPAddr).Port log.Println("Listening...") diff --git a/token.go b/token.go index d637e08..99868d2 100644 --- a/token.go +++ b/token.go @@ -65,7 +65,7 @@ func (t *Token) SignedString(key interface{}) (string, error) { func (t *Token) SigningString() (string, error) { var err error parts := make([]string, 2) - for i, _ := range parts { + for i := range parts { var jsonValue []byte if i == 0 { if jsonValue, err = json.Marshal(t.Header); err != nil {