Skip to content

Commit d3ec33e

Browse files
committed
fix: tests
1 parent f479a92 commit d3ec33e

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
//args: -Egovet
22
//config: linters-settings.govet.check-shadowing=true
3-
package govet
3+
package testdata
44

55
import (
66
"fmt"
77
"io"
88
"os"
99
)
1010

11-
func Composites() error {
11+
func GovetComposites() error {
1212
return &os.PathError{"first", "path", os.ErrNotExist} // ERROR "composites: \\`(os|io/fs)\\.PathError\\` composite literal uses unkeyed fields"
1313
}
1414

15-
func Shadow(f io.Reader, buf []byte) (err error) {
15+
func GovetShadow(f io.Reader, buf []byte) (err error) {
1616
if f != nil {
1717
_, err := f.Read(buf) // ERROR `shadow: declaration of .err. shadows declaration at line \d+`
1818
if err != nil {
@@ -24,20 +24,20 @@ func Shadow(f io.Reader, buf []byte) (err error) {
2424
return
2525
}
2626

27-
func NolintVet() error {
27+
func GovetNolintVet() error {
2828
return &os.PathError{"first", "path", os.ErrNotExist} //nolint:vet
2929
}
3030

31-
func NolintVetShadow() error {
31+
func GovetNolintVetShadow() error {
3232
return &os.PathError{"first", "path", os.ErrNotExist} //nolint:vetshadow
3333
}
3434

35-
func Printf() {
35+
func GovetPrintf() {
3636
x := "dummy"
3737
fmt.Printf("%d", x) // ERROR "printf: Printf format %d has arg x of wrong type string"
3838
}
3939

40-
func StringIntConv() {
40+
func GovetStringIntConv() {
4141
i := 42
42-
fmt.Println("i = " + string(i)) // ERROR "stringintconv: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)"
42+
fmt.Println("i = " + string(i)) // ERROR "stringintconv: conversion from int to string yields a string of one rune, not a string of digits \\(did you mean fmt.Sprint\\(x\\)\\?\\)"
4343
}

test/testdata/govet/ifaceassert.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

test/testdata/govet_ifaceassert.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//args: -Egovet
2+
//config: linters-settings.govet.enable=ifaceassert
3+
package testdata
4+
5+
import (
6+
"io"
7+
)
8+
9+
func GovetIfaceAssert() {
10+
var v interface {
11+
Read()
12+
}
13+
_ = v.(io.Reader) // ERROR "impossible type assertion: no type can implement both interface\\{Read\\(\\)\\} and io\\.Reader \\(conflicting types for Read method\\)"
14+
}

0 commit comments

Comments
 (0)