Skip to content

Releases: sidai/defaults

v1.0.1

24 Jul 03:50
6c269ea
Compare
Choose a tag to compare

Added support for dive key to

  1. Fill struct recursively when it is empty by default
  2. Always fill current struct when default:"dive" tag found
  3. Always skip struct filling when default:"omit" tag found

v1.0.0

23 Jul 11:34
Compare
Choose a tag to compare

Default values filling for almost all data types

  1. Primitive Types: bool, int/8/16/32/64, uint/8/16/32/64, float32/64, []byte, string
  2. Custom Types: time.Duration, time.Time
  3. Aliased types. e.g type UserName string
  4. Self-defined type. e.g. type User struct {Name string, Age int}
  5. Complex Types: map, slice, struct, interface
  6. Nested Types: e.g. map[int][]*User, []map[int]*User, map[int]map[int]*User
  7. Pointer Types: e.g. *int, *User, **int, **User