mirror of https://github.com/golang-jwt/jwt.git
Reformat code: add whitespaces, remove empty lines (#319)
This commit is contained in:
parent
33d62b4dae
commit
b2b650971a
|
@ -1,11 +1,10 @@
|
|||
package jwt
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"crypto"
|
||||
"crypto/ed25519"
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -114,7 +114,6 @@ func Example_getTokenViaHTTP() {
|
|||
}
|
||||
|
||||
func Example_useTokenViaHTTP() {
|
||||
|
||||
// Make a sample token
|
||||
// In a real world situation, this token will have been acquired from
|
||||
// some other API call (see Example_getTokenViaHTTP)
|
||||
|
|
|
@ -42,7 +42,6 @@ func init() {
|
|||
// Load private keys
|
||||
jwtTestRSAPrivateKey = test.LoadRSAPrivateKeyFromDisk("test/sample_key")
|
||||
jwtTestEC256PrivateKey = test.LoadECPrivateKeyFromDisk("test/ec256-private.pem")
|
||||
|
||||
}
|
||||
|
||||
var jwtTestData = []struct {
|
||||
|
@ -352,11 +351,9 @@ func signToken(claims jwt.Claims, signingMethod jwt.SigningMethod) string {
|
|||
}
|
||||
|
||||
func TestParser_Parse(t *testing.T) {
|
||||
|
||||
// Iterate over test data set and run tests
|
||||
for _, data := range jwtTestData {
|
||||
t.Run(data.name, func(t *testing.T) {
|
||||
|
||||
// If the token string is blank, use helper function to generate string
|
||||
if data.tokenString == "" {
|
||||
data.tokenString = signToken(data.claims, data.signingMethod)
|
||||
|
@ -428,7 +425,6 @@ func TestParser_Parse(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestParser_ParseUnverified(t *testing.T) {
|
||||
|
||||
// Iterate over test data set and run tests
|
||||
for _, data := range jwtTestData {
|
||||
// Skip test data, that intentionally contains malformed tokens, as they would lead to an error
|
||||
|
@ -670,13 +666,11 @@ func TestSetPadding(t *testing.T) {
|
|||
err,
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkParseUnverified(b *testing.B) {
|
||||
|
||||
// Iterate over test data set and run tests
|
||||
for _, data := range jwtTestData {
|
||||
// If the token string is blank, use helper function to generate string
|
||||
|
|
|
@ -41,7 +41,6 @@ func TestSingleArrayMarshal(t *testing.T) {
|
|||
expected := `"test"`
|
||||
|
||||
b, err := json.Marshal(s)
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %s", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue