-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix database configuration parsing for string representations of arrays #3275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
218c532
e5908bc
5983996
3ff95e6
aabceea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -692,6 +692,16 @@ func CastValueToKind(value any, kind reflect.Kind) (res any, ok bool) { | |
res = castStringToBool(fmt.Sprintf("%v", reflect.ValueOf(value))) | ||
ok = true | ||
} | ||
case reflect.Slice: | ||
// Handle string representations of slices, e.g., `["-u semaphore -b"]` | ||
if str, isString := value.(string); isString { | ||
var arr []string | ||
err := json.Unmarshal([]byte(str), &arr) | ||
if err == nil { | ||
res = arr | ||
ok = true | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Slice Unmarshalling Fails for Non-String TypesThe |
||
default: | ||
} | ||
|
||
|