Releases: dyweb/gommon
Releases · dyweb/gommon
Align error interface
Released on 2020/01/17
Breaking change
- Removed
errors.DirectCause
New feature
- Added
errors.Unwrapanderrors.Asto align with go 1.13 #109
Move httpclient from go.ice
Simple log registry
Released on 2019/04/28
Breaking change
- #112 Legacy package moved to its own repo gommon-legacy
- #110 Simplify log registry, no longer have tree
- #97 Contains a global registry
New feature
- #60 Use env var
GOMMON_LOG_LEVELto set default log level
Removed package
- #113 structure package is moved to legacy
Error categorization
Breaking change
- #74 Switched to go mod from dep
New feature
- #76 created
errors/errortypepackage for inspecting standard library error types,
and add three common error interfacesErrNotFound,ErrAlreadyExists,ErrNotImplemented
Fixed
- #108 log package was using
initto induct package level logger, it is changed toinit.ializers
Error inspection
Was planning to add error categorization, but end up implemented error inspection in go 2 proposal.
Also got a silly banner from @at15 \w/
New feature
- #66 error inspection without checking string, based on go 2 proposal
- #105
gommon add-build-ignoreused for disable all the legacy packages
Partial
- #74 created
go.modso gommon be used by thereplacedirective in other
go mod based projects, gommon itself is still using dep - #103 style guide, only covered general and is not well formatted
Removed package
Log refactor
- reduce handler interface from 6 methods to 1
- #88 add benchmark
- #33 #78 use log registry to keep tree of logger
- escape string in json handler
- #87 add multi handler for fan out
The main takeaway for the benchmarks are
- reduce number of alloc by allocate enough size in one call, it will reduce cpu time as well
- pass bytes slice all the way down the call stack to reduce alloc
- use interface methods cause parameters escape to heap, even buffer pool can't help you with that unless you eliminate interface use down the entire call stack
- you can still get good performance without using pool, logrus is using pool, but its performance is extremely poor
v0.0.7
errors
- #59 replace pkg/errors with gommon/errors, not drop in replacement, no
WithMessageandWithStack - multi error, a thread safe version (using mutex) is also provided
- error wrapping
- only add stack when previous error does not have one
- gommon generate adds blank line between header and package to avoid being treated as package comment