Skip to content

Commit

Permalink
Fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Mar 27, 2023
1 parent 7acdfa7 commit 62899ef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ on:
types: [opened, synchronize, reopened]

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
build:
runs-on: ubuntu-latest
strategy:
Expand Down
7 changes: 5 additions & 2 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func ExampleNewWithClaims_customClaimsType() {
jwt.RegisteredClaims
}

// Create the claims
// Create claims with multiple fields populated
claims := MyCustomClaims{
"bar",
jwt.RegisteredClaims{
Expand All @@ -53,6 +53,8 @@ func ExampleNewWithClaims_customClaimsType() {
},
}

fmt.Printf("foo: %v\n", claims.Foo)

// Create claims while leaving out some of the optional fields
claims = MyCustomClaims{
"bar",
Expand All @@ -67,7 +69,8 @@ func ExampleNewWithClaims_customClaimsType() {
ss, err := token.SignedString(mySigningKey)
fmt.Printf("%v %v", ss, err)

//Output: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJpc3MiOiJ0ZXN0IiwiZXhwIjoxNTE2MjM5MDIyfQ.xVuY2FZ_MRXMIEgVQ7J-TFtaucVFRXUzHm9LmV41goM <nil>
//Output: foo: bar
//eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJpc3MiOiJ0ZXN0IiwiZXhwIjoxNTE2MjM5MDIyfQ.xVuY2FZ_MRXMIEgVQ7J-TFtaucVFRXUzHm9LmV41goM <nil>
}

// Example creating a token using a custom claims type. The RegisteredClaims is embedded
Expand Down
6 changes: 4 additions & 2 deletions http_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ func Example_getTokenViaHTTP() {

// Read the token out of the response body
buf := new(bytes.Buffer)
io.Copy(buf, res.Body)
_, err = io.Copy(buf, res.Body)
fatal(err)
res.Body.Close()
tokenString := strings.TrimSpace(buf.String())

Expand Down Expand Up @@ -129,7 +130,8 @@ func Example_useTokenViaHTTP() {

// Read the response body
buf := new(bytes.Buffer)
io.Copy(buf, res.Body)
_, err = io.Copy(buf, res.Body)
fatal(err)
res.Body.Close()
fmt.Println(buf.String())

Expand Down
4 changes: 2 additions & 2 deletions request/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func (e HeaderExtractor) ExtractToken(req *http.Request) (string, error) {
type ArgumentExtractor []string

func (e ArgumentExtractor) ExtractToken(req *http.Request) (string, error) {
// Make sure form is parsed
req.ParseMultipartForm(10e6)
// Make sure form is parsed. We are explicitly ignoring errors at this point
_ = req.ParseMultipartForm(10e6)

// loop over arg names and return the first one that contains data
for _, arg := range e {
Expand Down

0 comments on commit 62899ef

Please sign in to comment.