Releases: gookit/goutil
Releases · gookit/goutil
v0.7.4
Change Log
Refactor
- refactor(strutil): reorganize imports and constants in convbase 5563461
Fixed
- fix(mathutil): Range - Fixed numeric parsing error message formatting and enhanced space handling f1a73b1
- fix(netutil): Fixed the behavior of the MustIPv4 function when the IPv4 address was not found e9a693a
Feature
- ✨ feat(mathutil): Added floating-point type checking and precision comparison functions 7dad98c
- ✨ feat(assert): add new assert func: InDelta 0ba9d40
- feat(testutil): new add EqFloat assert func 35c8022
- feat(cflag): Added hook function for pre-execution of commands 62bd5f7
- feat(byteutil): Added byte array reversal function 55af94b
- feat(arrutil): Add a slice and chunk function: Chunk, ChunkBy 01df1ac
- ✨ feat(maputil): added default value support for maputil.Data methods 76be7e9
- feat(testutil): Add the EqInt assertion function to compare different types of integer values 1da7022
- ✨ feat(syncs): Implement a goroutine-safe SafeMap data structure b7a8632
- feat(netutil): Add AllLocalIPv4 to get all non-loopback IPv4 addresses 2428d68
- feat(mathutil): Add numeric range parsing and expansion capabilities: Range, Expand 6fab454
- feat(netutil): Add AllMacAddrs to obtain all MAC addresses of the local machine. 07a1fed
- feat(capp): Add WrapRunFunc functionality and add tests for NewCmd c14ca41
- feat(netutil): Add FirstMacAddr to get the MAC address of the first non-loop NIC 8932d06
- feat(syncs): Add a panic recovery mechanism to the Go function eecd998
- feat(syncs): Add panic recovery to ErrGroup and implement the TryGo method f251413
- feat(cliutil): ReadInt Added integer reading from terminal c67b276
- feat(capp): Add the ability to display long help text for apps e0c7076
- feat(clog): Added color console log printing function 52e8b0a
- feat(testutil): Extend assertion library functionality and add fast failure support 9a273ec
- feat(testutil): assert added zero-value assertion functionality Zero, NotZero c45ff43
- feat(cliutil): Added CLI table rendering function SimpleTable, ShowTable, FormatTable a2cdd87
- feat(lcache): Adding a local cache implementation supports LRU and TTL functions eef430b
- feat(strutil): Add a unique number generator based on time bf1f81d
- feat(maputil): Add StrMapToText function and tests 0ea8f09
Update
- update(assert): add new assert func: ErrHasMsg d152b54
Other
- chore(mathutil): move OrElse,ZeroOr,LessOr,LteOr,GreaterOr,GteOr to compare.go b50a3eb
- docs(workflow): 更新 GitHub Actions 工作流配置 7249b9a
- test(syncs): SafeMap - Add concurrent security tests and improve test logic eec6033
- remove(lcache): move the lcache package to gookit/ext/lcache bcc89dd
- test(maputil): 修复map key无序导致 StrMapToText 测试失败 b2b406f
v0.7.3
Change Log
Feature
- ✨ feat: envutil - add built in dotenv files load and parse b30606b
- ✨ feat: x/fakeobj - add struct Clock, use for testing time clock 2a649e8
- feat: netutil - add new func: IncrIP cf17adf
Update
- 👔 up: strutil - add new func: Utf8Padding, Utf8Resize and fix some error on padding 0107e47
- 👔 up: envutil - dotenv add new option: LoadFirstExist 6d02a84
- 👔 up: x/termenv - fix GetTermSize error, add support from ENV get width and height 488eac7
Other
v0.7.2
Change Log
Fixed
- 🐛 fix: ccolor - fix NO_COLOR not working on print 1af9f30
- 🐛 fix: cflag - fix capp run error on parse global flags 608af27
- 🐛 fix: cflag - fix capp OnAppFlagParsed not fired on no command input f1f5a07
Feature
- ✨ feat(mathutil): add IsInteger func for strict check value is int(x), uint(x) 2ee7a62
- ✨ feat(mathutil): add StrictInt, StrictUint convert function 390ec5d
- ✨ feat: strutil - add new func: NumVersion for get version e2965ca
- ✨ feat: strutil - add new func ReplaceVars for quick render {var} string c8fb7d7
- ✨ feat: fsutil - add new util func EnsureDir, HomeDir/UserHomeDir 32ddd67
- ✨ feat: maputil - add new util func AppendSMap, AliasesNames b43e3f1
- ✨ feat: testutil/assert - add new assert func: StrContainsAll 2108aac
- ✨ feat: testutil - add SafeBuffer Thread-safe buffer for testing f673abe
- ✨ feat: cflag - add new config: HelpOnEmptyArgs, update help render da9a807
- ✨ feat: strutil - add new func: IsUpper, IsLower check string b07f0f2
- ✨ feat: arrutil - add new func: ToMap for convert list to map. b659b6d
- ✨ feat: timex - add new func: FormatDuration Formatting time consumption is clock format. e2147b2
- ✨ feat: mathutil - add new func: FormatBytes Format the byte size to be a readable string. 4427aef
- ✨ feat: testutil - EchoServer support response 404,405,500 or custom status relay b5b9623
- ✨ feat: fsutil - add new func: CreateSymlink, IsSymlink d2cdd27
- ✨ feat: arrutil - add new func: Map1 - convert a list to new list 3135923
- ✨ feat: strutil - add new func: IsUint, IsPositiveNum c182d09
- ✨ feat: fsutil - add new func: FindAllInParentDirs, FindOneInParentDirs, FindNameInParentDirs afb58ef
Update
- 👔 up: optimize common ToStringWith func logic f14bb21
- 👔 up: add test on latest go, add new func on syncs 74716d2
- 👔 up: cflag - update some for Cmd direct run 5fdbadb
- 👔 up: httpreq - add new func IsValidMethod 9f3f541
- ♻️ up: cflag - refactoring the cflag.App to subpkg capp.App f9b66fb
- 👔 up: maputil - Aliases add new method: GroupAliases 2ecbd3d
- 👔 up: textutil - VarReplacer support var-name as ENV-var to parse 1172f04
- ⚡ up: mathutil - optimize the ToInt64With handle options logic 6f37675
- 👔 up: mathutil - split convert value to intX codes to conv2int.go 8af351f
- 👔 up: mathutil - Optimized conversion to intX-related methods 22e641b
- 👔 up: strutil - add new func: DateSNv3 7b7d042
- 👔 up: strutil - update VersionCompare logic, fix some error acd18fa
- 👔 up: strutil - add new func: BaseConvInt, BaseConvIntByTpl 13376a1
- 👔 up: strutil - add new func: ContainsByteOne 1475b43
- 👔 up: strutil - update the MTimeBaseID support base > 36 0e971bf
Other
- Add comprehensive GitHub Copilot instructions for gookit/goutil development workflow (#229) 1fd676f
- Add FreeBSD/Unix support to sysutil package (#231) 3da5f32
- build(deps): bump github/codeql-action from 3 to 4 (#232) ebfe972
- Add ShowLen option to control length display in dump output (#234) 9174185
- 📝 chore: update some comments or code style ece5b55
- 👔 chore: update some code style and tests a313253
- 📝 chore: update README generate cli, update readme docs 2a9870c
- 📝 chore: update templates for README generate 53c0997
- ✅ test: fix unit test error and fix code style f8b5ac2
- 📝 chore: update README generate cli, update readme docs 2 0760bb2
- 📝 chore: update README generate cli, update readme docs 3 18adb71
What's Changed
- Add comprehensive GitHub Copilot instructions for gookit/goutil development workflow by @Copilot in #229
- Add FreeBSD/Unix support to sysutil package by @Copilot in #231
- build(deps): bump github/codeql-action from 3 to 4 by @dependabot[bot] in #232
- Add ShowLen option to control length display in dump output by @Copilot in #234
New Contributors
- @Copilot made their first contribution in #229
Full Changelog: v0.7.1...v0.7.2
v0.7.1
Change Log
Fixed
- 🐛 fix: maputil - TryAnyMap convert error on input no-string key map 095d51e
Feature
- ✨ feat: timex - Enhanced ToDuration method to support negative numbers and multiple time. eg: -1.5h, 2d3h, 2hour33min a9069e6
- ✨ feat: fsutil - add new func: NameNoExt get filename without ext 95581b1
- ✨ feat: maputil - add ToL2StringMap: convert map[string]any to map[string]map[string]string 1b4a87b
- ✨ feat: testutil - add StrVarRenderer implements like shell vars renderer 114d773
- ✨ feat: maputil - Data add new method: One, StrOne, StringsOne for try get value by multi key a877c56
- ✨ feat: maputil - add func: FirstKey for get first key string. 922d3cc
- ✨ feat: strutil - add func: IContainsOne, IContainsAll for support ignore-case check string. 6eb1356
- ✨ feat: strutil - add new func: JoinComma quick join strings by comma 3d40ebb
- ✨ feat: maputil - add func: AnyToStrMap for convert any to string-map 6f1a47f
- ✨ feat: maputil - Data add method: BoolOne, AnyMap for get value 721b544
- ✨ feat: maputil - add new type: L2StrMap and add new func: MergeL2StrMap da6c2b0
- ✨ feat: maputil - add new func: SliceToSMap, SliceToMap, SliceToTypeMap 9b99167
- ✨ feat: maputil - SMap add new method: StrOne for get first value by multi keys 993edb6
- ✨ feat: strutil - add new func: IsVarName for check varname string 34194ee
- ✨ feat: sysutil - add new func: ToEnvPATH join strings to PATH string 66d1416
- ✨ feat: sysutil/cmdr - Cmd add new field PrintLine for print show cmdline a14f77b
- ✨ feat: reflects - add func: TryAnyMap for convert any map to string-any map f839da3
- ✨ feat: structs - StructToMap add new options: IgnoreEmpty, UserFunc 001c4da
- ✨ feat: structs - SetValues add new options: BeforeSetFn hook 4a8b758
Update
- 👔 up: env, strutil - Extract the common ENV lines parse method to the internal package 2b5a873
- 👔 up: maputil - rename SMap to StrMap 2caae27
- 👔 up: jsonutil - add new func: DecodeFile bbb7603
- 👔 up: sysutil add const OsName, goutil add func: IfElseFn 65f84e5
Other
- 📝 doc: update and add some docs for structs, testutil, x/finder 4f00e86
- 💚 test: fix the internal ParseEnvLines in some case error e693ecd
- 👔 chore: update import, rename some vars 9e89bd1
- 👔 chore: arrutil - update the ToStrings logic 7847933
- 👔 chore: errorx - add alias method Rf for Rawf 6109707
- 💡 chore: update or fix some func comments 583c720
- 💡 chore: update some comments and code style 7c15564
- ⬆️ dep: update gh checkout action to v5 b12ec64
- 📝 doc: update and re-generate README docs 18a8667
Full Changelog: v0.7.0...v0.7.1
v0.7.0
Change Log
Refactor
- ♻️ refactoring: move the encodes package to x/encodes 275d1f4
- ♻️ refactor: stdio - move goutil/stdio to goutil/x/stdio 1057fb5
- ♻️ refactor: fmtutil - move goutil/fmtutil to goutil/x/fmtutil e2c8bed
- ♻️ refactor: clipboard - move goutil/sysutil/clipboard to goutil/x/clipboard c47cf3b
- ♻️ refactor: finder - move goutil/fsutil/finder to goutil/x/finder 48963af
- ♻️ refactor: goinfo - move package goutil/goinfo to goutil/x/goinfo 9e28205
Fixed
- 🐛 fix: finder - fix finder repeat run error and add more tests ff84828
- fix: termenv - update color detect check on *nix OS 3aba144
- fix: termenv - DetectColorLevel unit test error a619d5a
- fix: termenv - DetectColorLevel unit test error2 16a948d
Feature
- ✨ feat: fsutil - add new util func: PathNoExt 1b36cbd
- ✨ feat: strutil - add new util func: IsInt, IsFloat, IsHttpURL f28e12c
- ✨ feat: fsutil/finder - support find work with concurrency mode 0d05af8
- ✨ feat: cflag - cli app support add global flags 97ce9f4
- ✨ feat: arrutil - add new util func: FirstOr 7dfe0b2
- ✨ feat: envutil - add new util func: MustGet, GetOne ad34b9b
- ✨ feat: structs - Added time parsing function on InitDefaults, SetValues b5f2898
- ✨ feat: reflects - Added time and duration type check and conversion functions 7e5b0c4
- ✨ feat: x/ccolor - add new sub package support ANSI color render cc18ef1
- ✨ feat: testutil - add new env test util: SetOsEnvs, RemoveTmpEnvs d42514a
- ✨ feat: assert - add new assert util: FileExists/FileNotExists, DirExists/DirNotExists acbca15
- ✨ feat: strutil - add new util: Md5Base62, MTimeBase36 0609161
- ✨ feat: termenv - add new sub package: x/termenv for check color support 289707b
- ✨ feat: textutil - add new util func: ParseSimpleINI format contents to a string-map 5ad7251
- ✨ feat: envutil - add new util: SplitText2map, LoadString, LoadText 6325333
- ✨ feat: testutil - add new util: MockHttpServer, RunOnCleanEnv 207e2ed
Update
- ✨ up: fsutil/finder - update some worker logic, optimize concurrent processing 00abc00
- ✨ up: use built in x/ccolor instead gookit/color package 63046e6
- ✨ up: comdef - add some new type or interface definition c17033c
- ✨ up: httpreq - update RespX, read response body to buffer for repeat uses. af68747
- ✨ up: byteutil add new func: Md5Sum, fmtutil add alias func: HumanSize 01b2768
- ✨ up: dump - add new option: MaxElementsNum 6539924
- 👔 up: x/ccolor - use new package x/termenv check color env 05fbe68
- 👔 up: update some sys env util func d22980b
- 👔 up: sysutil/cmdr - update print context and fix workdir set error e5b0158
- ✨ up: move basefn package to the x dir 5bafec6
- ✨ up: move testuitl/fakeobj package to the x dir 57b7410
- 👔 up: update some util and fix some unit test error c0c7593
- 👔 up: update and re-generate README docs ea3a9b3
- 👔 up: add new type Number instead XintOrFloat 24da798
- 👔 up: cli - update cmd line build logic 8bcf999
Other
- build(deps): bump golang.org/x/term from 0.27.0 to 0.28.0 (#210) 923cb8b
- build(deps): bump golang.org/x/sys from 0.29.0 to 0.30.0 (#212) d978612
- build(deps): bump golang.org/x/sync from 0.10.0 to 0.11.0 (#211) 7642483
- build(deps): bump golang.org/x/text from 0.21.0 to 0.22.0 (#213) 5270f1d
- build(deps): bump golang.org/x/term from 0.28.0 to 0.29.0 (#214) 93c1e39
- build(deps): bump golang.org/x/sys from 0.30.0 to 0.31.0 (#216) 0543d03
- build(deps): bump golang.org/x/sync from 0.11.0 to 0.12.0 (#215) f00496a
- build(deps): bump golang.org/x/term from 0.29.0 to 0.30.0 (#218) 7c4c6e0
- build(deps): bump golang.org/x/text from 0.22.0 to 0.23.0 (#217) 42892a4
- ⬇️ dep: down some deps version to support go<1.23 9c54e2c
- ✅ test: comdef - add more func test cases d34ee22
- ✅ test: syncs - add more func test cases a23fb81
- 📝 chore: fsutil - update some debug logs for finder 3be227e
- ✅ test: add more unit test cases for arr,map,str,sys utils a2303f0
- ✅ test: add more unit test cases for cflag,assert,timex 6bbb455
- 👷 test: fsutil/finder - add more test cases 9918541
- 👷 ci: add run unit test on go>1.21 c661585
- 📝 doc: update some docs and comments b44963d
- 📝 chore: update some code style and pkg import f53908d
- ✅ test: update and fix some unit tests error e2b6b2a
- ➖ dep: remove depends on the xo/terminfo package 7b4f3e8
- 💚 test: x/termenv - fix ci test error on macOS 9290735
- 💚 test: dump, x/termenv - fix ci test error on ubuntu os ca8fe91
- 💚 test: x/ccolor - fix ci test error for TestApplyTag 5f8ec75
- 📝 doc: update some docs and re-generate README 14cf523
- ✅ test: ccolor,te...
v0.6.18
Change Log
Fixed
- ✨ fix: cflag - get app name error, path.Base not support windows a2decab
- 🐛 fix: sys - UserConfigDir path build error f308913
- 🐛 fix: sys - UserXXDir func test error on windows 83393ca
Feature
- ✨ feat: cflag - add command support by struct cflag.Cmd 21b0dcd
Update
- ✨ up: cflag - app add new hook BeforeRun and call os.Exit on run error e0591f5
- 👔 up: cflag - app hook BeforeRun add new param c97c8d0
- 👔 up: sysutil - ShellExec support handle use cmd,pwsh shell on Windows c1f379f
- 👔 up: sysutil - SearchPath will limit ext search on windows e7da787
- 👔 up: sysutil - modify the exec command logic, always return combined output 49bc6ed
- ✨ up: cflag - app add new hook AfterRun on cmd run after aef1d43
- ✨ up: strutil - add new function: SplitByWhitespace 342cd12
- 👔 up: all - use path/filepath instead of path for support Windows ba0623b
- 👔 up: mathutil - convert string to int, int64 support float string ebc89cd
- 👔 up: fsutil - add new func: JoinPaths3, update some tests 1ef5549
- 👔 up: sysutil - add new OSVersionInfo for parse Windows version info f2ce64c
- 👔 up: cflag - print error stack on debug mode eb4fc22
- 👔 up: sys/process - add new func: ExistsByName, StopByName cd830b9
- 👔 up: sys - add new func: IsAdmin, enhance func: UserDir, UserConfigDir 57a5103
Other
- build(deps): bump golang.org/x/text from 0.18.0 to 0.19.0 (#196) 1e250bf
- build(deps): bump golang.org/x/sys from 0.25.0 to 0.26.0 (#198) a74c379
- build(deps): bump golang.org/x/term from 0.24.0 to 0.25.0 (#197) b7cc07b
- ✨ enhanced: dump - support for parse alias type of time.Time. close #200 e959274
- Added new OrElseNilSafe to handle nil pointers for optional strings. (#199) c5e194a
- build(deps): bump golang.org/x/term from 0.25.0 to 0.27.0 (#208) 2ad2195
- build(deps): bump golang.org/x/sync from 0.8.0 to 0.10.0 (#206) 8e25dc1
- build(deps): bump golang.org/x/text from 0.19.0 to 0.21.0 (#207) 7ae8ce4
v0.6.17
Change Log
Fixed
- fix: dumper.printRValue panic when unexported fields in the structure are of type time.Time; (#183) 4143c5b
- 🐛 fix: cflag - not add NewLine on each option description f1ad3a6
- 🐛 fix: structs - fix TryToMap panic on handle invalid field value ebc746c
- 🐛 fix: structs - InitDefaults: can't set slice to array. close #172 c341f68
Other
- build(deps): bump morphy2k/revive-action from 2.5.7 to 2.5.10 (#191) 3c4153f
- build(deps): bump golang.org/x/term from 0.22.0 to 0.23.0 (#188) 5c4823d
- ci: remote the morphy2k/revive-action d81967d
- build(deps): bump golang.org/x/sys from 0.23.0 to 0.25.0 (#193) 717b4f5
- build(deps): bump golang.org/x/text from 0.16.0 to 0.18.0 (#194) 0a4c580
- build(deps): bump golang.org/x/term from 0.23.0 to 0.24.0 (#195) b511ebd
v0.6.16
Change Log
Fixed
- 🐛 fix: fs - ToAbsPath if input is empty will return current work dir deb03c0
Feature
- ✨ feat: math - add generic func Abs 45cdda2
- ✨ feat: map - add new func: TypedKeys, TypedValues, EachTypedMap for get typed key or value from map dc3c50a
- ✨ feat: assert - add new func: StrNotContains for check string value dce0f0b
- ✨ feat: IsEmptyReal and IsZeroReal method (#174) f480138
- ✨ feat: support convert float string to int (#180) 5bdbe2a
Update
- 👔 up: test,base - update some test and base func ac5dfa1
- 🚚 up: rename the reflects.IsValidatePtr to reflects.IsValidPtr 8b32a51
- 👔 up: str - random string gen split non-win and windows implement 5f16ce7
- 👔 up: assert - add new helper func: ContainsElems 1c08e6b
- 👔 up: fsutil add const and update the FindInDir() 0f525a0
Other
- build(deps): bump morphy2k/revive-action from 2.5.4 to 2.5.6 (#152) 73a2aba
- build(deps): bump WillAbides/setup-go-faster from 1.13.0 to 1.14.0 (#153) 4ea333f
- 🎨 style: update and fix some code style problem 66e926c
- build(deps): bump morphy2k/revive-action from 2.5.6 to 2.5.7 (#160) 08ec3bd
- Add new function reflect.IsValidatePtr (#163) 5c01479
- build(deps): bump softprops/action-gh-release from 1 to 2 (#165) 479e259
- 👔 chore: update some deps to latest, and update some type comments 7c5136a
- ✅ ci: fix ci test error and add test on go1.22 9203a60
- build(deps): bump golang.org/x/text from 0.14.0 to 0.15.0 (#171) 03a1013
- build(deps): bump golang.org/x/sys from 0.18.0 to 0.20.0 (#169) 4978a3a
- build(deps): bump golang.org/x/term from 0.18.0 to 0.20.0 (#170) 68ce124
- build(deps): bump golang.org/x/sync from 0.6.0 to 0.7.0 (#166) aec44b2
- support default env prefix (#178) 43e6c53
- ⬆️ dep: upgrade golang.org/x deps to latest version bfe7659
v0.6.15
Change Log
Fixed
- 🐛 fix: strutil - fix random method unit test error 2a189eb
- 🐛 fix: support use JSON as env default value on parse struct. see issues #135 79a8767
- 🐛 fix: envutil - parse env var check error 300ee26
- 🐛 fix: conv - fix some to unit convert tests error 58c5080
Feature
- ✨ feat: math - add Uint64, ToUint64 and related util func 8373e84
- ✨ feat: math,str - move the common ToStringWith func to internal package f9a9690
- ✨ feat: dump - special handle for time.Time type display 1d0e7a0
- ✨ feat: enhance the convert func, support handle ptr type value 3ace818
Update
- 👔 up: map - add some new method for Map, SMap data 678218d
- 👔 up: maputil - fix a method name error, add tests for MergeMultiSMap e0bbc86
- ♻️ up: math - update all value convert to other type func logic, support more options a1e842e
- 👔 up: structs - update the SetValues logic will continue on set error dd72232
- 👔 up: reflects,internal - update some internal and reflects util func 154fd5b
Other
- build(deps): bump morphy2k/revive-action from 2.5.3 to 2.5.4 (#136) b8698a4
- dep: upgrade some deps to latest version f34c186
- build(deps): bump WillAbides/setup-go-faster from 1.12.0 to 1.13.0 (#145) bf7f993
- build(deps): bump golang.org/x/term from 0.13.0 to 0.15.0 (#144) b73b8e9
- Modify struct field setting logic. (#138) 4eb9721
- 📝 doc: add package comments for some subpackage a49dc1c
- 💚 ci: math, str - fix some convert tests error 4275d2c
- 💚 ci: math - fix run ci tests error on go1.19 a6a8d0e
- 📝 doc: update and re-generate README docs 71e9b89
- build(deps): bump github/codeql-action from 2 to 3 (#147) d397d97
- 📝 doc: re-generate new README and fix some code style 9ef6bd0