Commit b2017651 authored by Manuel Kieweg's avatar Manuel Kieweg 🤷
Browse files

go fmt

parent b3babef2
...@@ -12,29 +12,29 @@ func TestRun(t *testing.T) { ...@@ -12,29 +12,29 @@ func TestRun(t *testing.T) {
request string request string
} }
tests := []struct { tests := []struct {
name string name string
args args args args
want interface{} want interface{}
}{ }{
{ {
name: "liveliness indicator", name: "liveliness indicator",
args: args{request: apiEndpoint + "/livez"}, args: args{request: apiEndpoint + "/livez"},
want: http.StatusOK, want: http.StatusOK,
}, },
{ {
name: "readyness indicator", name: "readyness indicator",
args: args{request: apiEndpoint + "/readyz"}, args: args{request: apiEndpoint + "/readyz"},
want: http.StatusOK, want: http.StatusOK,
}, },
{ {
name: "init", name: "init",
args: args{request: apiEndpoint + "/api?q=init"}, args: args{request: apiEndpoint + "/api?q=init"},
want: http.StatusOK, want: http.StatusOK,
}, },
} }
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
go func() { go func() {
if err := Run(ctx); err != nil{ if err := Run(ctx); err != nil {
t.Errorf("Run() error = %v", err) t.Errorf("Run() error = %v", err)
} }
}() }()
......
...@@ -233,7 +233,7 @@ func (g *Gnmi) set(ctx context.Context, setOps []*gnmi.Operation, ...@@ -233,7 +233,7 @@ func (g *Gnmi) set(ctx context.Context, setOps []*gnmi.Operation,
func (g *Gnmi) subscribe(ctx context.Context) error { func (g *Gnmi) subscribe(ctx context.Context) error {
ctx = gnmi.NewContext(ctx, &g.Options.Config) ctx = gnmi.NewContext(ctx, &g.Options.Config)
opts, ok := ctx.Value(CtxKeyOpts).(*gnmi.SubscribeOptions) opts, ok := ctx.Value(CtxKeyOpts).(*gnmi.SubscribeOptions)
if !ok{ if !ok {
return &ErrInvalidTypeAssertion{ return &ErrInvalidTypeAssertion{
v: reflect.TypeOf(ctx.Value(CtxKeyOpts)), v: reflect.TypeOf(ctx.Value(CtxKeyOpts)),
t: reflect.TypeOf(&gnmi.SubscribeOptions{}), t: reflect.TypeOf(&gnmi.SubscribeOptions{}),
......
...@@ -46,7 +46,6 @@ var gnmiAddress = "141.100.70.171:6030" ...@@ -46,7 +46,6 @@ var gnmiAddress = "141.100.70.171:6030"
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
log.SetReportCaller(true) log.SetReportCaller(true)
if os.Getenv("GOSDN_LOG") == "nolog" { if os.Getenv("GOSDN_LOG") == "nolog" {
log.SetLevel(log.PanicLevel) log.SetLevel(log.PanicLevel)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment