From 3d59e5e89e775b1d33a451aca6aa4bda4fbad500 Mon Sep 17 00:00:00 2001 From: Alex Flint Date: Fri, 20 Aug 2021 19:52:48 -0700 Subject: bump go-scalar to v1.1 and add documentation about supported types --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 48fa2f0..229a9df 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,22 @@ func main() { As usual, any field tagged with `arg:"-"` is ignored. +### Supported types + +The following types may be used as arguments: +- built-in integer types: `int, int8, int16, int32, int64, byte, rune` +- built-in floating point types: `float32, float64` +- strings +- booleans +- URLs represented as `url.URL` +- time durations represented as `time.Duration` +- email addresses represented as `mail.Address` +- MAC addresses represented as `net.HardwareAddr` +- pointers to any of the above +- slices of any of the above +- maps using any of the above as keys and values +- any type that implements `encoding.TextUnmarshaler` + ### Custom parsing Implement `encoding.TextUnmarshaler` to define your own parsing logic. -- cgit v1.2.3