• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber-go / fx / 2360 / 2
91%
master: 92%

Build:
Build:
LAST BUILD BRANCH: glue-dig-b3
DEFAULT BRANCH: master
Ran 11 Mar 2017 10:36PM UTC
Files 53
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Mar 2017 10:29PM UTC coverage: 91.242%. First build
DOCKER_GO_VERSION=1.8 CI_TEST_CMD=coveralls

push

travis-ci

sectioneight
Add task.MustRegister which panics on error

Although panics are generally frowned upon, there are certain cases
where they can make developers' lives easier. Particularly for the task
module, the general use case is that in the `main` func (or some other
func called by `main` during initialization), there is no way to recover
from the error and we want to crash the process.

In abscence of MustRegister, a developer who wishes to register many
tasks must check the error of each, and upon encountering an error will
almost certainly want to exit the program with a non-zero exit code
since the service should not start if the task functions are not
properly defined.

In other words, it turns this:

  if err := task.Register(FirstTaskFunc); err != nil {
    log.Fatal("Could not register task", err.Error())
  }
  if err := task.Register(SecondTaskFunc); err != nil {
    log.Fatal("Could not register task", err.Error())
  }

Into this:

  task.MustRegister(FirstTaskFunc)
  task.MustRegister(SecondTaskFunc)

Both of which behave semantically similar (although the output may be
slightly different).

This gives developers the flexibility to choose which behavior they
want, similar to `regexp.MustCompile` from the standard library, where a
program should not start if the developer incorrectly constructed a
regular expression.

2813 of 3083 relevant lines covered (91.24%)

24.38 hits per line

Source Files on job 2360.2 (DOCKER_GO_VERSION=1.8 CI_TEST_CMD=coveralls)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2360
  • Travis Job 2360.2
  • a6b6376e on github
  • Next Job for DOCKER_GO_VERSION=1.8 CI_TEST_CMD=coveralls on must-register (#2364.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc