Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 384c30c

Browse filesBrowse files
committed
Improved error message
1 parent 9cd9c97 commit 384c30c
Copy full SHA for 384c30c

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎internal/go-configmap/configuration.go

Copy file name to clipboardExpand all lines: internal/go-configmap/configuration.go
+6-1Lines changed: 6 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.