21 lines
385 B
Go
21 lines
385 B
Go
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
|
|
}
|
|
|
|
func maxUint(a, b uint) uint {
|
|
if b > a {
|
|
return b
|
|
}
|
|
return a
|
|
}
|