Skip to content
Snippets Groups Projects
Commit d173ec2d authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

disable linting for context with value

parent 4ddb8455
Branches
Tags
2 merge requests!120Resolve "Code Quality",!90Develop
......@@ -47,7 +47,7 @@ func Subscribe(a, u, p string, sample, heartbeat int64, args ...string) error {
}
done := make(chan os.Signal, 1)
signal.Notify(done, syscall.SIGILL, syscall.SIGTERM)
ctx := context.WithValue(context.Background(), nucleus.CtxKeyOpts, opts)
ctx := context.WithValue(context.Background(), nucleus.CtxKeyOpts, opts) //nolint
go func() {
if err := device.Transport.Subscribe(ctx); err != nil {
log.Fatal(err)
......
......@@ -170,7 +170,7 @@ func (g *Gnmi) Capabilities(ctx context.Context) (interface{}, error) {
"target": g.Options.Addr,
}).Info("sending gNMI capabilities request")
ctx = gnmi.NewContext(ctx, &g.Options.Config)
ctx = context.WithValue(ctx, CtxKeyConfig, &g.Options.Config)
ctx = context.WithValue(ctx, CtxKeyConfig, &g.Options.Config) //nolint
resp, err := g.client.Capabilities(ctx, &gpb.CapabilityRequest{})
if err != nil {
return nil, err
......@@ -182,7 +182,7 @@ func (g *Gnmi) Capabilities(ctx context.Context) (interface{}, error) {
func (g *Gnmi) get(ctx context.Context, paths [][]string, origin string) (interface{}, error) {
ctx = gnmi.NewContext(ctx, &g.Options.Config)
ctx = context.WithValue(ctx, CtxKeyConfig, &g.Options.Config)
ctx = context.WithValue(ctx, CtxKeyConfig, &g.Options.Config) //nolint
req, err := gnmi.NewGetRequest(ctx, paths, origin)
if err != nil {
return nil, err
......
......@@ -268,7 +268,7 @@ func TestGnmi_SubscribeIntegration(t *testing.T) {
t.Error(err)
return
}
ctx := context.WithValue(context.Background(), "opts", tt.args.opts)
ctx := context.WithValue(context.Background(), CtxKeyOpts, tt.args.opts) //nolint
ctx, cancel := context.WithCancel(ctx)
go func() {
err = g.Subscribe(ctx)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment