Modified toString function to encode a copy instead of the real (re-used) object, added schema tests for model.ChangeContext line and column on enum changes.

This commit is contained in:
Amit Reinich
2024-01-11 11:32:09 +02:00
committed by quobix
parent d7c6474908
commit 2a1e4e5b91
2 changed files with 8 additions and 2 deletions

View File

@@ -405,7 +405,9 @@ func ExtractStringValueSliceChanges(lParam, rParam []low.ValueReference[string],
func toString(v any) string {
if y, ok := v.(*yaml.Node); ok {
_ = y.Encode(&v)
copy := *y
_ = copy.Encode(&copy)
return fmt.Sprint(copy)
}
return fmt.Sprint(v)