Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 2.82 KB

attribution.md

File metadata and controls

50 lines (36 loc) · 2.82 KB

Attribution & Comparison

Gommon is inspired by many awesome libraries. However, we chose to reinvent the wheel for most of them. Doing so allow us to shrink codebase, introduce break changes frequently, unify error handling and logging.

errors

log

  • sirupsen/logrus for structured logging
    • log v1 is entirely modeled after logrus, entry contains log information with methods like Info, Infof
  • apex/log for log handlers
    • log v2's handler is inspired by apex/log, but we didn't use entry struct and chose to pass multiple parameters to explicitly state what a handler should handle. This can avoid the problem of adding extra context and ignored silently by existing handler implementations.
  • uber-go/zap for serialize log fields without using fmt.Sprintf and use strconv directly
    • we didn't go that extreme as Zap or ZeroLog for zero allocation, performance is currently not measured

noodle

config

  • spf13/cast for cast, it is used by Viper
  • spf13/viper for config
    • looking up config via string key makes type system useless, so we always marshal entire config file to a single struct
      • it also makes refactor easier
    • we only use YAML, might add RCL

requests

generator