Skip to content
Snippets Groups Projects
Commit 95b602c0 authored by Malte Bauch's avatar Malte Bauch
Browse files

comments for context keys

parent c38cf281
Branches
Tags
2 merge requests!120Resolve "Code Quality",!90Develop
......@@ -11,9 +11,15 @@ import (
"strings"
)
// CtxKeyType is a custom type to be used as key in a context.WithValue() or
// context.Value() call. For more information see:
// https://www.calhoun.io/pitfalls-of-context-values-and-how-to-avoid-or-mitigate-them/
type CtxKeyType string
const (
// CtxKeyOpts context key for gnmi.SubscribeOptions
CtxKeyOpts CtxKeyType = "opts"
// CtxKeyConfig is a context key for gnmi.Config
CtxKeyConfig = "config"
)
......
......@@ -109,7 +109,7 @@ func TestGnmi_SetIntegration(t *testing.T) {
if err != nil && tt.wantErr {
return
} else if got.Prefix.Target != address ||
got.Response[0].Op != gpb.UpdateResult_UPDATE{
got.Response[0].Op != gpb.UpdateResult_UPDATE {
t.Errorf("Set() got = %v, want %v", got, tt.want)
}
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment