|
|
@ -3,8 +3,8 @@ package cli
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"flag"
|
|
|
|
"flag"
|
|
|
|
"sort"
|
|
|
|
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"sort"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
@ -328,7 +328,7 @@ func TestContextPropagation(t *testing.T) {
|
|
|
|
parent := NewContext(nil, nil, nil)
|
|
|
|
parent := NewContext(nil, nil, nil)
|
|
|
|
parent.Context = context.WithValue(context.Background(), "key", "val")
|
|
|
|
parent.Context = context.WithValue(context.Background(), "key", "val")
|
|
|
|
ctx := NewContext(nil, nil, parent)
|
|
|
|
ctx := NewContext(nil, nil, parent)
|
|
|
|
val := ctx.Value("key")
|
|
|
|
val := ctx.Context.Value("key")
|
|
|
|
if val == nil {
|
|
|
|
if val == nil {
|
|
|
|
t.Fatal("expected a parent context to be inherited but got nil")
|
|
|
|
t.Fatal("expected a parent context to be inherited but got nil")
|
|
|
|
}
|
|
|
|
}
|
|
|
|