26 lines
419 B
Go
26 lines
419 B
Go
|
package db
|
||
|
|
||
|
import "strings"
|
||
|
|
||
|
func IsLocationTypeValid(l string) bool {
|
||
|
var validLocationTypes = []LocationType{
|
||
|
LocationTypeAmusementpark,
|
||
|
LocationTypeBeach,
|
||
|
LocationTypeCulinary,
|
||
|
LocationTypeHikingCamping,
|
||
|
LocationTypeOther,
|
||
|
}
|
||
|
|
||
|
lTypes := strings.Split(l, ",")
|
||
|
|
||
|
for _, v := range validLocationTypes {
|
||
|
for _, k := range lTypes {
|
||
|
if v != LocationType(k) {
|
||
|
return false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return true
|
||
|
}
|