rkt/rkt

Wrap logging + os.Exit calls in a package

Open

#2452 opened on Apr 19, 2016

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Go (8,871 stars) (865 forks)batch import
area/developer toolinghelp wantedlow hanging fruittechnology/go

Description

There are lots of os.Exit invocations and logging calls before them throughout the code.

We can improve the readability by creating a new exit package that also supports formatting by using something like this:

  • exit.Success("operation successful %q", output) or exit.OK("operation successful")
  • exit.Error("cannot do something")

After that we can intercept the invocations for testing purposes as well.

Contributor guide