Skip to content

Commit

Permalink
use cleaner version of prefix checking (thanks shurcooL)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrijalva committed Nov 13, 2015
1 parent dd0ede9 commit d9df83c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmd/jwt/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"io/ioutil"
"os"
"regexp"
"strings"

"github.com/dgrijalva/jwt-go"
)
Expand Down Expand Up @@ -205,8 +206,5 @@ func signToken() error {
}

func isEs() bool {
if alg := *flagAlg; len(alg) >= 2 && alg[0:2] == "ES" {
return true
}
return false
return strings.HasPrefix(*flagAlg, "ES")
}

0 comments on commit d9df83c

Please sign in to comment.