refactor: battle at controller
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package controller
|
||||
|
||||
import "strings"
|
||||
|
||||
// validateTypeName always return v without leading and trailing spaces
|
||||
func validateTypeName(v string) (string, bool) {
|
||||
s := strings.TrimSpace(v)
|
||||
if len(s) > 0 {
|
||||
return s, true
|
||||
}
|
||||
// TODO: special symbols AND include error check in all user-input test
|
||||
return s, false
|
||||
}
|
||||
Reference in New Issue
Block a user