
Some checks failed
Extra / Vulnerability scanner (push) Has been cancelled
CI / go-mod (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Release a tag / release (push) Has been cancelled
CI / tests-on-windows (push) Has been cancelled
CI / tests-on-macos (push) Has been cancelled
CI / tests-on-unix (1.15) (push) Has been cancelled
CI / tests-on-unix (1.16) (push) Has been cancelled
CI / check_generated (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/Dockerfile.alpine]) (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/Dockerfile]) (push) Has been cancelled
19 lines
618 B
Go
19 lines
618 B
Go
//args: -Eimportas
|
|
//config_path: testdata/configs/importas.yml
|
|
package testdata
|
|
|
|
import (
|
|
wrong_alias "fmt" // ERROR `import "fmt" imported as "wrong_alias" but must be "fff" according to config`
|
|
"os"
|
|
wrong_alias_again "os" // ERROR `import "os" imported as "wrong_alias_again" but must be "std_os" according to config`
|
|
|
|
wrong "github.com/pkg/errors" // ERROR `import "github.com/pkg/errors" imported as "wrong" but must be "pkgerr" according to config`
|
|
)
|
|
|
|
func ImportAsWrongAlias() {
|
|
wrong_alias.Println("foo")
|
|
wrong_alias_again.Stdout.WriteString("bar")
|
|
os.Stdout.WriteString("test")
|
|
_ = wrong.New("baz")
|
|
}
|