Table Of Content
- Read struct tags
- Get and set struct fields
- Fill slice with values
- Set a value of a number
- Decode key-value pairs into map
- Decode key-value pairs into struct
- Encode struct into key-value pairs
- Check if the underlying type implements an interface
- Function calls
Read struct tags
1 | package main |
Calling to Kind()
can returns one of this list.
Get and set struct fields
1 | package main |
Fill slice with strings, without knowing its type. Use case: decoder.
1 | package main |
Set a value of a number. Use case: decoder.
1 | package main |
Decode key-value pairs into map
1 | package main |
Decode key-value pairs into struct
1 | package main |
Encode struct into key-value pairs
1 | package main |
Check if the underlying type implements an interface
1 | package main |
Function calls
Call method without prameters, and without return value
1 | package main |
Call function with list of arguments, and validate return values
1 | package main |
Call to a function dynamically. similar to the template/text package
1 | package main |
Call function with variadic parameter
1 | package main |
Create function at runtime
1 | package main |