Skip to content
Snippets Groups Projects
Commit 48917ba5 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

refactor empty string comparison

parent 8921c7e9
No related branches found
No related tags found
No related merge requests found
......@@ -28,13 +28,13 @@ func (i *STID) Valid() bool {
}
func (i *STID) HashValid() bool {
if len(i.hash) > 0 {
if i.hash != "" {
return true
}
if i.UUID.String() == "00000000-0000-0000-0000-000000000000" {
return false
}
return len(i.Hash()) > 0
return i.Hash() != ""
}
func (i *STID) Hash() string {
......
......@@ -266,7 +266,7 @@ func IsJWT(token string) bool {
return false
}
for i, segment := range arr {
if len(segment) > 0 || i < 2 { // first two segments must not be empty
if segment != "" || i < 2 { // first two segments must not be empty
if _, err := base64.URLEncoding.DecodeString(arr[2]); err != nil {
return false
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment