Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 661f08c

Browse files
committedMay 3, 2024
Improved error message
1 parent 4d4af4a commit 661f08c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎internal/go-configmap/configuration.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ func tryConversion(current any, desiredType reflect.Type) (any, error) {
109109
}
110110
return currentArray, nil
111111
}
112-
return nil, fmt.Errorf("invalid conversion, got %T but want %v", current, desiredType)
112+
113+
currentTypeString := currentType.String()
114+
if currentTypeString == "[]interface {}" {
115+
currentTypeString = "array"
116+
}
117+
return nil, fmt.Errorf("invalid conversion, got %s but want %v", currentTypeString, desiredType)
113118
}
114119

115120
func (c Map) set(keys []string, value any) {

0 commit comments

Comments
 (0)
Please sign in to comment.