Allow Mappers to contribute Vars to interpolation.

See #218.
This commit is contained in:
Alec Thomas
2021-09-27 16:07:48 +10:00
parent dd18549686
commit 1d48b6f720
3 changed files with 39 additions and 0 deletions
+5
View File
@@ -115,6 +115,11 @@ type Mapper interface {
Decode(ctx *DecodeContext, target reflect.Value) error
}
// VarsContributor can be implemented by a Mapper to contribute Vars during interpolation.
type VarsContributor interface {
Vars(ctx *Value) Vars
}
// A BoolMapper is a Mapper to a value that is a boolean.
//
// This is used solely for formatting help.