Skip to content

Releases: shockerli/cvt

v0.2.8

20 Dec 12:00
Compare
Choose a tag to compare

Features

  • Support IsEmpty to checks value for empty state
  • Support Len to return size of string, slice, array or map
  • Support TimeFormats to add custom time format
  • Support IntMapE

v0.2.7

09 Oct 02:23
Compare
Choose a tag to compare

Features

  • add global variable cvt.TimeLocation, default time.UTC, can custom settings
  • add cvt.TimeInLocation() / cvt.TimeInLocationE() to support custom location

v0.2.6

07 Oct 03:04
Compare
Choose a tag to compare
  • improve performance for slice functions
  • fix: time.Duration to time.Time

v0.2.5

10 Sep 09:59
Compare
Choose a tag to compare

Features

  • Time*() improve performance for direct type
  • Time*() support time.Duration
  • Time*() support json.Number
  • Time*() support indirect of time.Time
  • Float*() improve performance for direct type
  • Float*() support time.Duration
  • Float*() support json.Number
  • Indirect() has exported
    func Indirect(a interface{}) (val interface{}, rv reflect.Value)

v0.2.4

06 Sep 14:35
Compare
Choose a tag to compare

Features

  • Bool improve performance for direct type
  • Bool support time.Duration
  • Bool support json.Number
  • Support new functions: Field / SliceInt / SliceInt64 / SliceFloat64 / SliceString
func Field(v interface{}, field interface{}, def ...interface{}) interface{}
func SliceInt(v interface{}, def ...[]int) []int
func SliceInt64(v interface{}, def ...[]int64) []int64
func SliceFloat64(v interface{}, def ...[]float64) []float64
func SliceString(v interface{}, def ...[]string) []string

v0.2.3

03 Sep 05:27
Compare
Choose a tag to compare

Features

  • support *P functions return the pointer of converted value #6
BoolP(v interface{}, def ...bool) *bool
StringP(v interface{}, def ...string) *string
Float32P(v interface{}, def ...float32) *float32
Float64P(v interface{}, def ...float64) *float64
Uint64P(v interface{}, def ...uint64) *uint64
Uint32P(v interface{}, def ...uint32) *uint32
Uint16P(v interface{}, def ...uint16) *uint16
Uint8P(v interface{}, def ...uint8) *uint8
UintP(v interface{}, def ...uint) *uint
Int64P(v interface{}, def ...int64) *int64
Int32P(v interface{}, def ...int32) *int32
Int16P(v interface{}, def ...int16) *int16
Int8P(v interface{}, def ...int8) *int8
IntP(v interface{}, def ...int) *int

v0.2.2

03 Sep 02:40
Compare
Choose a tag to compare

Bug Fixes

  • fix: int string convert to int64 lose precision #7

v0.2.1

05 Jan 07:34
0ba7150
Compare
Choose a tag to compare

Features

  • KeysE support fields of struct
  • Add func StringMapE
    • Support JSON string/[]byte of map
    • Support any map type
    • Support any struct type
  • int* support "00100", "-00100", "00100.00", "00100.01"

v0.2.0

19 Oct 10:01
Compare
Choose a tag to compare
  • support indirect type for []byte
  • support interface alias type for nil
  • improve direct type performance for int*uint*string
  • adapter 32 bit system and test cases
  • remove all imported packages(testify), no imports, more pure

v0.1.3

22 Jul 11:56
Compare
Choose a tag to compare
reorganize code structure