2022-07-08 22:54:33 +02:00
|
|
|
package advsql
|
|
|
|
|
2022-07-11 13:00:36 +02:00
|
|
|
import "time"
|
2022-07-08 22:54:33 +02:00
|
|
|
|
2022-07-11 13:00:36 +02:00
|
|
|
type defaultDecoderType interface {
|
|
|
|
~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64 | ~string | ~bool | time.Time
|
2022-07-08 22:54:33 +02:00
|
|
|
}
|
|
|
|
|
2022-07-11 13:00:36 +02:00
|
|
|
// Decoder provides default decoders for primitive datatypes
|
|
|
|
func Decoder[T defaultDecoderType](value *T, decode DecodeFunc) error {
|
2022-07-08 22:54:33 +02:00
|
|
|
return decode(value)
|
|
|
|
}
|