Supported field types

KCD supports natives types, standard unmarshaler, and custom types.

Native types

All of this can be assigned from a string. for example, if you try to set a value of -1 to a uint you will get a bad request error. I let you try.

  • String

  • Int

  • Int8

  • Int16

  • Int32

  • Int64

  • Uint

  • Uint8

  • Uint16

  • Uint32

  • Uint64

  • Bool

  • Float32

  • Float64

Standard Unmarshaler

Custom types

Custom types are used with contexts: You can set your field type as the type of the value of your context et voilà!

For more information please visit the decoding package from KCD.

Last updated

Was this helpful?