A collection of Go utility packages from lontten, built on lcore/v2 types such as LocalDate, LocalDateTime, and Decimal.
- Go 1.25+
go get -u github.com/lontten/lutil| Package | Description |
|---|---|
lutil |
Goroutine pool, key-based mutex (KeyLock) |
codeutil |
Encoding, hashing, random strings; HashPassword/VerifyPassword (bcrypt; prefer over deprecated EnPwd) |
dateutil |
LocalDate comparison and aggregation |
datetimeutil |
LocalDateTime comparison and aggregation |
decimalutil |
decimal.Decimal arithmetic helpers |
fileutil |
Temp files, copy, path helpers |
fuzzutil |
Fuzzy matching (Like) and vocabulary extraction |
imgutil |
Image download, Base64, HTML/richtext image handling |
jsonutil |
JSON marshal/unmarshal helpers |
listutil |
Slice set operations and ListTool |
logutil |
Simple logging helpers |
moneyutil |
Money/decimal operations and discount helpers |
netutil |
HTTP, IP resolution, file download |
numutil |
Numeric utilities |
perfutil |
Simple performance timing |
structutil |
Struct ↔ map conversion |
strutil |
String checks and substring helpers |
This release includes breaking changes:
netutil.CleanStringwas removed. Map spaces/controls yourself, or useSafeFileNamefor filenames.- Prefer
netutil.SafeFileNameover deprecatedSafeURL(output may differ:filepath.Base, extension-preserving truncate). DownloadFileToLocalaccepts HTTP 200 only, caps at 500MB, and uses a 30s timeout; useDownloadFileToLocalLimitfor other size limits.netutilHTTP helpers (Get,PostJson*,PostForm*) use a 30s default timeout.- Pool
SubmitErrreturns sentinel errors: useerrors.Is(err, lutil.ErrQueueFull)/ErrPoolClosedinstead of matching error strings.
go mod verify
go test -race -count=1 ./...Apache-2.0. See LICENSE.