Skip to content

Commit

Permalink
update rtc message (#107)
Browse files Browse the repository at this point in the history
Co-authored-by: dzhang <dzhang@anduril.com>
  • Loading branch information
derekhuizhang and dzhang committed Mar 2, 2022
1 parent 0c18668 commit a2e7449
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions pkg/golinters/runtimeconfig.go
Expand Up @@ -68,8 +68,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
if defaultConfig == nil {
pass.Reportf(
defaultConfArg.Pos(),
"expected 2nd arg to be non nil but got %v",
defaultConfig,
"expected non nil struct as 2nd arg to Get",
)
return
}
Expand Down
14 changes: 7 additions & 7 deletions test/testdata/runtimeconfig_test.go
Expand Up @@ -35,12 +35,12 @@ func GetTest() {
rtc := setup()
// nil or primitive values are not allowed
rtc.Get("", nil, nil) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
rtc.Get("", nil, nil) // __ERROR__ "expected non nil struct as 2nd arg to Get"
rtc.Get("", T1{}, nil) // __ERROR__ "expected configuration object as 3rd arg but got nil"
rtc.Get("", nil, &T1{}) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
rtc.Get("", true, false) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
rtc.Get("", "", "") // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
rtc.Get("", 123, 456) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
rtc.Get("", nil, &T1{}) // __ERROR__ "expected non nil struct as 2nd arg to Get"
rtc.Get("", true, false) // __ERROR__ "expected non nil struct as 2nd arg to Get"
rtc.Get("", "", "") // __ERROR__ "expected non nil struct as 2nd arg to Get"
rtc.Get("", 123, 456) // __ERROR__ "expected non nil struct as 2nd arg to Get"
// 3rd arg needs to be a ref (update in-place)
t1 := T1{}
Expand Down Expand Up @@ -82,8 +82,8 @@ func SubscribeTest() {
rtc := setup()
// nil args
rtc.Subscribe("", nil, nil) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
rtc.Subscribe("", nil, func(c interface{}) *graphene.ApplyError { // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
rtc.Subscribe("", nil, nil) // __ERROR__ "expected non nil struct as 2nd arg to Get"
rtc.Subscribe("", nil, func(c interface{}) *graphene.ApplyError { // __ERROR__ "expected non nil struct as 2nd arg to Get"
return nil
})
t1 := T1{}
Expand Down

0 comments on commit a2e7449

Please sign in to comment.