Skip to content

Releases: dyweb/gommon

Align error interface

18 Jan 08:03
Compare
Choose a tag to compare

Released on 2020/01/17

closed issues

Breaking change

  • Removed errors.DirectCause

New feature

  • Added errors.Unwrap and errors.As to align with go 1.13 #109

Move httpclient from go.ice

04 May 20:58
Compare
Choose a tag to compare

Released on 2019/05/04

closed issues

New feature

Simple log registry

28 Apr 20:56
Compare
Choose a tag to compare

Released on 2019/04/28

closed issues

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_LEVEL to set default log level

Removed package

  • #113 structure package is moved to legacy

Error categorization

13 Apr 21:47
Compare
Choose a tag to compare

closed issues

Breaking change

  • #74 Switched to go mod from dep

New feature

  • #76 created errors/errortype package for inspecting standard library error types,
    and add three common error interfaces ErrNotFound, ErrAlreadyExists, ErrNotImplemented

Fixed

  • #108 log package was using init to induct package level logger, it is changed to init.ializers

Error inspection

31 Dec 06:50
Compare
Choose a tag to compare

closed issues

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-ignore used for disable all the legacy packages

Partial

  • #74 created go.mod so gommon be used by the replace directive 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

  • #68 deprecate request package, use httpclient in go.ice#37

Log refactor

09 Dec 09:06
Compare
Choose a tag to compare

closed issues

  • 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

09 Aug 23:35
1eed5cf
Compare
Choose a tag to compare
  • remove config package, deprecated v1, moved to legacy folder
  • move cast to util/cast

errors

26 Feb 19:35
1eed5cf
Compare
Choose a tag to compare
  • #59 replace pkg/errors with gommon/errors, not drop in replacement, no WithMessage and WithStack
  • 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

doc

04 May 02:02
55cec89
Compare
Choose a tag to compare
doc

Breaking

  • fix typo in log package EnableSourceRecursive

Doc

  • improve doc for log, errors #69

Noodle

21 Feb 10:03
Compare
Choose a tag to compare
  • #47 support embed using generated file
  • #46 local folder w/ disable list directory support