Use interface{} instead of string in tokens.
This allows the scanner and resolvers to pass Go types around rather than having to serialise/deserialise to/from strings.
This commit is contained in:
+2
-2
@@ -140,8 +140,8 @@ type mappedValue struct {
|
||||
}
|
||||
|
||||
func (m *mappedValue) Decode(ctx *kong.DecodeContext) error {
|
||||
m.decoded = ctx.Scan.PopValue("mapped")
|
||||
return nil
|
||||
_, err := ctx.Scan.PopValueInto("mapped", &m.decoded)
|
||||
return err
|
||||
}
|
||||
|
||||
func TestMapperValue(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user