Browse Source

Simplify if expression (gosimple)

pkg/util/shortid_generator.go:20:2: should use 'return <expr>' instead of 'if <expr> { return <bool> }; return <bool>' (S1008)
Karsten Weiss 7 years ago
parent
commit
da5654ad04
1 changed files with 1 additions and 5 deletions
  1. 1 5
      pkg/util/shortid_generator.go

+ 1 - 5
pkg/util/shortid_generator.go

@@ -17,11 +17,7 @@ func init() {
 
 
 // IsValidShortUid checks if short unique identifier contains valid characters
 // IsValidShortUid checks if short unique identifier contains valid characters
 func IsValidShortUid(uid string) bool {
 func IsValidShortUid(uid string) bool {
-	if !validUidPattern(uid) {
-		return false
-	}
-
-	return true
+	return validUidPattern(uid)
 }
 }
 
 
 // GenerateShortUid generates a short unique identifier.
 // GenerateShortUid generates a short unique identifier.