Skip to content

Commit 67159a4

Browse files
fix: Simplify DefaultValue handling
1 parent f90e27b commit 67159a4

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

  • internal/pkg/service/stream/mapping/table/column

internal/pkg/service/stream/mapping/table/column/renderer.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,11 @@ func (r *Renderer) jsonPathCSVValue(c Path, ctx recordctx.Context) (string, erro
148148
return value.String(), nil
149149
} else if c.DefaultValue != nil {
150150
// An error happened while processing the path, but we have a DefaultValue to use.
151-
var result any = *c.DefaultValue
152-
153151
if c.RawString {
154-
if stringValue, ok := result.(string); ok {
155-
return stringValue, nil
156-
}
152+
return *c.DefaultValue, nil
157153
}
158154

159-
return json.EncodeString(result, false)
155+
return json.EncodeString(*c.DefaultValue, false)
160156
}
161157

162158
return "", resultErr

0 commit comments

Comments
 (0)