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

jjeffery / errors / 3
97%

Build:
DEFAULT BRANCH: master
Ran 06 Oct 2016 05:18AM UTC
Jobs 3
Files 4
Run time 8s
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

pending completion
3

push

travis-ci

jjeffery
The implementation of the Context interface now has a Keyvals method.

This does not change the public interface, but it opens up some intriguing possibilities for unifying logging and error parameters.

For example:
```go
func doSomethingWith(ctx context.Context, userID string, documentID string) error {
    errors := errors.With("userID", userID, "documentID", documentID)
    log := log.FromContext(ctx).With(errors)

    // ... rest of function here ...
```

In this scenario, the errors context is created, so any errors created in the function will
have the userID and documentID attached. This function also happens to log messages,
and it wants the same context for logging. Because the errors context implements the
keyvalser interface, the log With method will accept it a s a list of key/value pairs.

This all pre-supposes that the logging framework is making use of package kv. Untried
as of yet, but it looks pretty promising.

182 of 182 relevant lines covered (100.0%)

36.48 hits per line

Jobs
ID Job ID Ran Files Coverage
1 3.1 06 Oct 2016 05:18AM UTC 0
100.0
Travis Job 3.1
2 3.2 06 Oct 2016 05:18AM UTC 0
100.0
Travis Job 3.2
3 3.3 06 Oct 2016 05:18AM UTC 0
100.0
Travis Job 3.3
Source Files on build 3
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #3
  • 62b8a6d1 on github
  • Prev Build on master (#2)
  • Next Build on master (#4)
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