refactor(eventlog) rename ContextWithLoggable
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com> fix(eventlog) compilation error License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Brian Tiger Chow committed
Nov 22, 2014 at 20:39 UTC
58d299eb2e35e01827e7f43f3a94df966215c61f
2 files changed
+4
-4
util/eventlog/context.go
+1
-1
@@ -10,7 +10,7 @@ type key int
10
11
const metadataKey key = 0
12
13
-func ContextWithMetadata(ctx context.Context, l Loggable) context.Context {
13
+func ContextWithLoggable(ctx context.Context, l Loggable) context.Context {
14
existing, err := MetadataFromContext(ctx)
15
if err != nil {
16
// context does not contain meta. just set the new metadata
util/eventlog/context_test.go
+3
-3
@@ -10,7 +10,7 @@ func TestContextContainsMetadata(t *testing.T) {
10
t.Parallel()
11
12
m := Metadata{"foo": "bar"}
13
- ctx := ContextWithMetadata(context.Background(), m)
13
+ ctx := ContextWithLoggable(context.Background(), m)
14
got, err := MetadataFromContext(ctx)
15
if err != nil {
16
t.Fatal(err)
@@ -25,8 +25,8 @@ func TestContextContainsMetadata(t *testing.T) {
25
func TestContextWithPreexistingMetadata(t *testing.T) {
26
t.Parallel()
27
28
- ctx := ContextWithMetadata(context.Background(), Metadata{"hello": "world"})
29
- ctx = ContextWithMetadata(ctx, Metadata{"goodbye": "earth"})
28
+ ctx := ContextWithLoggable(context.Background(), Metadata{"hello": "world"})
29
+ ctx = ContextWithLoggable(ctx, Metadata{"goodbye": "earth"})
30
31
got, err := MetadataFromContext(ctx)
32
if err != nil {