Repository navigation
support maps in marker marker parsing - #329
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold this is partial -- whether we merge this depends on how it works with #323 |
|
There's one caveat: we'll never "guess" an empty map to be a map (we depend on the presence of |
Maps in markers always have string keys, and may have any value type. "Guessed" maps are always non-uniform (i.e. key of AnyType), since they're frequently used to represent objects in JSON form.
This supports changing field names in anonymous markers, meaning you can
have a marker like
```
//+default=<any>
```
map to a struct
```
type Default struct {
Value interface{}
}
```
by changing the definition up a bit.
This supports when you need to make an any-type definition and also
implement methods on it, like for defaulting.
f663527 to
57ecfbd
Compare
|
I've rebased #323 on this PR and it works like a charm. LGTM |
|
/lgtm |
|
/hold cancel |
Maps in markers always have string keys, and may have any argument type, including
nested maps, slices, etc.
"Guessed" maps are always non-uniform (i.e. key of AnyType), since
they're frequently used to represent objects in JSON form.
They syntax looks like: