databricks-cli/libs/dyn/dynvar
Pieter Noordhuis a95b1c7dcf
Retain location information of variable reference (#1333)
## Changes

Variable substitution works as if the variable reference is literally
replaced with its contents.

The following fields should be interpreted in the same way regardless of
where the variable is defined:
```yaml
foo: ${var.some_path}
bar: "./${var.some_path}"
```

Before this change, `foo` would inherit the location information of the
variable definition. After this change, it uses the location information
of the variable reference, making the behavior for `foo` and `bar`
identical.

Fixes #1330.

## Tests

The new test passes only with the fix.
2024-04-03 10:40:29 +00:00
..
lookup.go Add `dynvar` package for variable resolution with a `dyn.Value` tree (#1143) 2024-01-24 18:49:06 +00:00
lookup_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00
ref.go Allow use of variables references in primitive non-string fields (#1219) 2024-02-19 10:44:51 +00:00
ref_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00
resolve.go Retain location information of variable reference (#1333) 2024-04-03 10:40:29 +00:00
resolve_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00