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:
Alec Thomas
2019-04-24 23:18:57 +10:00
parent 2ac3d43124
commit 439c674f7a
9 changed files with 296 additions and 172 deletions
+2 -2
View File
@@ -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) {