Skip to content

Commit

Permalink
fix parameterType.Kind()
Browse files Browse the repository at this point in the history
  • Loading branch information
tzhao-viant committed May 1, 2024
1 parent 728ea17 commit cc574ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions service/session/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,16 @@ func (s *Session) adjustValue(parameter *state.Parameter, value interface{}) (in
switch actual := value.(type) {
case string:
if textValue, ok := value.(string); ok {

if parameterType.Kind() == reflect.String {
return textValue, nil
}
if parameterType.Kind() == reflect.Ptr {
if parameterType.Elem().Kind() == reflect.String {
return textValue, nil
}
}

if parameterStructType != nil && parameter.OutputType() != nil {
return textValue, nil
}
Expand Down

0 comments on commit cc574ab

Please sign in to comment.