dragoonchang
dragoonchang
I am working on Arrays. How should we define the type of parameter key regarding support/arr? In Golang, any comparable types can be key so that the range can be...
Using map.Get appears more natural and is easier to understand and maintain. However, one downside is that we require users to use aliases when using arr.Get and map.Get together. Personally,...
Using https://github.com/gookit/goutil can save us a lot of time, and I will prioritize using its available functions.
I have done two functions, and please give me some feedback, thanks: /support/arr/arr.go: ```golang package arr import "errors" var ErrInvalidKey = errors.New("key should be greater than or equal to 0")...
updated, if no issues, I will finish other funcs and PR: /support/arr/arr.go: ```golang package arr func Get[T any](arr []T, key int, def T) T { if key < 0 {...