use cleaner version of prefix checking (thanks shurcooL)

This commit is contained in:
Dave Grijalva 2015-11-13 15:03:12 -08:00
parent dd0ede9741
commit d9df83c827
1 changed files with 2 additions and 4 deletions

View File

@ -14,6 +14,7 @@ import (
"io/ioutil"
"os"
"regexp"
"strings"
"github.com/dgrijalva/jwt-go"
)
@ -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")
}