dromara / carbon

A simple, semantic and developer-friendly golang package for time
https://pkg.go.dev/github.com/golang-module/carbon/v2
MIT License
4.77k stars 238 forks source link

DiffAbsInDuration must upgrade go version to 1.9+ #226

Closed xu9374 closed 6 months ago

xu9374 commented 7 months ago

in v2.3.9+DiffAbsInDuration used Duration.Abs(),but this func must in go version 1.9+,see api: audit for Go 1.19 and time: add Duration.Abs if my go version is below 1.9, it will not compile successfully. report github.com/golang-module/carbon/v2@v2.3.10/difference.go:212:40](http://github.com/golang-module/carbon/v2@v2.3.10/difference.go:212:40): end.StdTime().Sub(c.StdTime()).Abs undefined (type time.Duration has no field or method Abs) Do you need to update the documentation to explain that you need to use go 1.9+ after version 2.3.9+?

gouguoyin commented 7 months ago

Thank you for your feedback. I will pay attention to this issue

gouguoyin commented 7 months ago

The next version will implement Abs method by itself

gouguoyin commented 6 months ago

V2.3.11 has been optimized and released