diff --git a/ndef/types.go b/ndef/types.go index dbac06d..3e517f7 100644 --- a/ndef/types.go +++ b/ndef/types.go @@ -44,3 +44,16 @@ type SortedType interface { type ScalarType interface { Int | Uint | Float | ~string | ~bool } + +type ArgInt []int + +// Get int by index from int slice +func (a ArgInt) Get(i int, args ...int) (r int) { + if i >= 0 && i < len(a) { + r = a[i] + } + if len(args) > 0 { + r = args[0] + } + return +}