5 func VariableListElementTypesAreHomogenous(variableName string, list []Variable) (Type, error) {
7 return TypeInvalid, fmt.Errorf("list %q does not have any elements so cannot determine type.", variableName)
10 elemType := TypeUnknown
11 for _, v := range list {
12 if v.Type == TypeUnknown {
16 if elemType == TypeUnknown {
21 if v.Type != elemType {
22 return TypeInvalid, fmt.Errorf(
23 "list %q does not have homogenous types. found %s and then %s",
35 func VariableMapValueTypesAreHomogenous(variableName string, vmap map[string]Variable) (Type, error) {
37 return TypeInvalid, fmt.Errorf("map %q does not have any elements so cannot determine type.", variableName)
40 elemType := TypeUnknown
41 for _, v := range vmap {
42 if v.Type == TypeUnknown {
46 if elemType == TypeUnknown {
51 if v.Type != elemType {
52 return TypeInvalid, fmt.Errorf(
53 "map %q does not have homogenous types. found %s and then %s",