Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
danet
goSDN
Commits
b2017651
Commit
b2017651
authored
Mar 29, 2021
by
Manuel Kieweg
🤷
Browse files
go fmt
parent
b3babef2
Changes
3
Hide whitespace changes
Inline
Side-by-side
nucleus/controller_test.go
View file @
b2017651
...
...
@@ -12,29 +12,29 @@ func TestRun(t *testing.T) {
request
string
}
tests
:=
[]
struct
{
name
string
args
args
want
interface
{}
name
string
args
args
want
interface
{}
}{
{
name
:
"liveliness indicator"
,
args
:
args
{
request
:
apiEndpoint
+
"/livez"
},
want
:
http
.
StatusOK
,
name
:
"liveliness indicator"
,
args
:
args
{
request
:
apiEndpoint
+
"/livez"
},
want
:
http
.
StatusOK
,
},
{
name
:
"readyness indicator"
,
args
:
args
{
request
:
apiEndpoint
+
"/readyz"
},
want
:
http
.
StatusOK
,
name
:
"readyness indicator"
,
args
:
args
{
request
:
apiEndpoint
+
"/readyz"
},
want
:
http
.
StatusOK
,
},
{
name
:
"init"
,
args
:
args
{
request
:
apiEndpoint
+
"/api?q=init"
},
want
:
http
.
StatusOK
,
name
:
"init"
,
args
:
args
{
request
:
apiEndpoint
+
"/api?q=init"
},
want
:
http
.
StatusOK
,
},
}
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
go
func
()
{
if
err
:=
Run
(
ctx
);
err
!=
nil
{
if
err
:=
Run
(
ctx
);
err
!=
nil
{
t
.
Errorf
(
"Run() error = %v"
,
err
)
}
}()
...
...
nucleus/gnmi_transport.go
View file @
b2017651
...
...
@@ -233,7 +233,7 @@ func (g *Gnmi) set(ctx context.Context, setOps []*gnmi.Operation,
func
(
g
*
Gnmi
)
subscribe
(
ctx
context
.
Context
)
error
{
ctx
=
gnmi
.
NewContext
(
ctx
,
&
g
.
Options
.
Config
)
opts
,
ok
:=
ctx
.
Value
(
CtxKeyOpts
)
.
(
*
gnmi
.
SubscribeOptions
)
if
!
ok
{
if
!
ok
{
return
&
ErrInvalidTypeAssertion
{
v
:
reflect
.
TypeOf
(
ctx
.
Value
(
CtxKeyOpts
)),
t
:
reflect
.
TypeOf
(
&
gnmi
.
SubscribeOptions
{}),
...
...
nucleus/initialise_test.go
View file @
b2017651
...
...
@@ -46,7 +46,6 @@ var gnmiAddress = "141.100.70.171:6030"
func
TestMain
(
m
*
testing
.
M
)
{
log
.
SetReportCaller
(
true
)
if
os
.
Getenv
(
"GOSDN_LOG"
)
==
"nolog"
{
log
.
SetLevel
(
log
.
PanicLevel
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment