docs: fix typos in testdata (#4116)
This commit is contained in:
parent
be034aa9af
commit
fe268f4ee9
2
test/testdata/forbidigo_example.go
vendored
2
test/testdata/forbidigo_example.go
vendored
@ -10,6 +10,6 @@ import (
|
|||||||
|
|
||||||
func Forbidigo() {
|
func Forbidigo() {
|
||||||
fmt.Printf("too noisy!!!") // want "use of `fmt\\.Printf` forbidden by pattern `fmt\\\\.Print\\.\\*`"
|
fmt.Printf("too noisy!!!") // want "use of `fmt\\.Printf` forbidden by pattern `fmt\\\\.Print\\.\\*`"
|
||||||
fmt2.Printf("too noisy!!!") // Not detected because analyze-types is false by default for backward compatbility.
|
fmt2.Printf("too noisy!!!") // Not detected because analyze-types is false by default for backward compatibility.
|
||||||
time.Sleep(time.Nanosecond) // want "no sleeping!"
|
time.Sleep(time.Nanosecond) // want "no sleeping!"
|
||||||
}
|
}
|
||||||
|
2
test/testdata/gochecknoglobals.go
vendored
2
test/testdata/gochecknoglobals.go
vendored
@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var noGlobalsVar int // want "noGlobalsVar is a global variable"
|
var noGlobalsVar int // want "noGlobalsVar is a global variable"
|
||||||
var ErrSomeType = errors.New("test that global erorrs aren't warned")
|
var ErrSomeType = errors.New("test that global errors aren't warned")
|
||||||
|
|
||||||
var (
|
var (
|
||||||
OnlyDigites = regexp.MustCompile(`^\d+$`)
|
OnlyDigites = regexp.MustCompile(`^\d+$`)
|
||||||
|
16
test/testdata/nonamedreturns_custom.go
vendored
16
test/testdata/nonamedreturns_custom.go
vendored
@ -56,21 +56,21 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// this should not match as the implementation does not need named parameters (see below)
|
// this should not match as the implementation does not need named parameters (see below)
|
||||||
type funcDefintion func(arg1, arg2 interface{}) (num int, err error)
|
type funcDefinition func(arg1, arg2 interface{}) (num int, err error)
|
||||||
|
|
||||||
func funcDefintionImpl(arg1, arg2 interface{}) (int, error) {
|
func funcDefinitionImpl(arg1, arg2 interface{}) (int, error) {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func funcDefintionImpl2(arg1, arg2 interface{}) (num int, err error) { // want `named return "num" with type "int" found`
|
func funcDefinitionImpl2(arg1, arg2 interface{}) (num int, err error) { // want `named return "num" with type "int" found`
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func funcDefintionImpl3(arg1, arg2 interface{}) (num int, _ error) { // want `named return "num" with type "int" found`
|
func funcDefinitionImpl3(arg1, arg2 interface{}) (num int, _ error) { // want `named return "num" with type "int" found`
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func funcDefintionImpl4(arg1, arg2 interface{}) (_ int, _ error) {
|
func funcDefinitionImpl4(arg1, arg2 interface{}) (_ int, _ error) {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,12 +88,12 @@ func test() {
|
|||||||
a := funcVar()
|
a := funcVar()
|
||||||
_ = a
|
_ = a
|
||||||
|
|
||||||
var function funcDefintion
|
var function funcDefinition
|
||||||
function = funcDefintionImpl
|
function = funcDefinitionImpl
|
||||||
i, err := function("", "")
|
i, err := function("", "")
|
||||||
_ = i
|
_ = i
|
||||||
_ = err
|
_ = err
|
||||||
function = funcDefintionImpl2
|
function = funcDefinitionImpl2
|
||||||
i, err = function("", "")
|
i, err = function("", "")
|
||||||
_ = i
|
_ = i
|
||||||
_ = err
|
_ = err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user