Skip to content

Commit a2e7449

Browse files
derekhuizhangdzhang
and
dzhang
authored
update rtc message (#107)
Co-authored-by: dzhang <[email protected]>
1 parent 0c18668 commit a2e7449

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

pkg/golinters/runtimeconfig.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ func run(pass *analysis.Pass) (interface{}, error) {
6868
if defaultConfig == nil {
6969
pass.Reportf(
7070
defaultConfArg.Pos(),
71-
"expected 2nd arg to be non nil but got %v",
72-
defaultConfig,
71+
"expected non nil struct as 2nd arg to Get",
7372
)
7473
return
7574
}

test/testdata/runtimeconfig_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ func GetTest() {
3535
rtc := setup()
3636
3737
// nil or primitive values are not allowed
38-
rtc.Get("", nil, nil) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
38+
rtc.Get("", nil, nil) // __ERROR__ "expected non nil struct as 2nd arg to Get"
3939
rtc.Get("", T1{}, nil) // __ERROR__ "expected configuration object as 3rd arg but got nil"
40-
rtc.Get("", nil, &T1{}) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
41-
rtc.Get("", true, false) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
42-
rtc.Get("", "", "") // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
43-
rtc.Get("", 123, 456) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
40+
rtc.Get("", nil, &T1{}) // __ERROR__ "expected non nil struct as 2nd arg to Get"
41+
rtc.Get("", true, false) // __ERROR__ "expected non nil struct as 2nd arg to Get"
42+
rtc.Get("", "", "") // __ERROR__ "expected non nil struct as 2nd arg to Get"
43+
rtc.Get("", 123, 456) // __ERROR__ "expected non nil struct as 2nd arg to Get"
4444
4545
// 3rd arg needs to be a ref (update in-place)
4646
t1 := T1{}
@@ -82,8 +82,8 @@ func SubscribeTest() {
8282
rtc := setup()
8383
8484
// nil args
85-
rtc.Subscribe("", nil, nil) // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
86-
rtc.Subscribe("", nil, func(c interface{}) *graphene.ApplyError { // __ERROR__ "expected 2nd arg to be non nil but got <nil>"
85+
rtc.Subscribe("", nil, nil) // __ERROR__ "expected non nil struct as 2nd arg to Get"
86+
rtc.Subscribe("", nil, func(c interface{}) *graphene.ApplyError { // __ERROR__ "expected non nil struct as 2nd arg to Get"
8787
return nil
8888
})
8989
t1 := T1{}

0 commit comments

Comments
 (0)