Skip to content

Commit

Permalink
♻️ up: math - update all value convert to other type func logic, supp…
Browse files Browse the repository at this point in the history
…ort more options

options:
- NilAsFail  default false: value is nil, will convert to zero value
  • Loading branch information
inhere committed Dec 7, 2023
1 parent 300ee26 commit a1e842e
Show file tree
Hide file tree
Showing 3 changed files with 338 additions and 239 deletions.
3 changes: 3 additions & 0 deletions comdef/comdef.go
Expand Up @@ -9,6 +9,9 @@ type (
UnmarshalFunc func(bts []byte, ptr any) error
)

// ToTypeFunc convert value to defined type
type ToTypeFunc[T any] func(any) (T, error)

// IntCheckFunc check func
type IntCheckFunc func(val int) error

Expand Down

0 comments on commit a1e842e

Please sign in to comment.