Commit graph

4 commits

Author SHA1 Message Date
Sebastiaan van Stijn
f4be328bff
context: TestWithTrace(): inline checkContextForValues, use sub-tests
checkContextForValues was effectively running sub-tests, but disguided
as a helper (to DRY). While it helped some duplication, rewriting it to
run subtests within a helper also was a bit confusing, so just inline
what it does.

While updating, also run tests with t.Parallel()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 13:54:37 +02:00
Sebastiaan van Stijn
2829f7b7d5
context: use consistent names for test-tables
Also renamed a var that collided with a type, and marked a helper
as t.Helper()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 13:54:37 +02:00
Stephen J Day
9c88801a12
context: remove definition of Context
Back in the before time, the best practices surrounding usage of Context
weren't quite worked out. We defined our own type to make usage easier.
As this packaged was used elsewhere, it make it more and more
challenging to integrate with the forked `Context` type. Now that it is
available in the standard library, we can just use that one directly.

To make usage more consistent, we now use `dcontext` when referring to
the distribution context package.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-08-11 15:53:31 -07:00
Stephen J Day
d8ac79f643 Contextual tracing support for logs
This adds WithTrace function to the context package that allows users to trace
a time span between a trace allocation and returned function call. The
resulting context includes ids that will allow for future dapper-like analysis.

Please see the godoc addition for details.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-04-10 16:42:30 -07:00