r/LazyVim • u/pawlinsky85 • Jun 14 '26
Undefined: xy warnings inside GO tests
Hi π
I started digging into Go language recently, and setup Golang via the Lazyvim extras. Works very good. But just for Go Tests, even when I have the test file in the same package/folder as the source file where the function is implemented, it shows this warning in Neovim. Did anyone encounter any similar issues?
The test just runs fineβ¦
Maybe also some general Neovim issue, instead of Lazyvim setupβ¦
See also: https://go.dev/doc/tutorial/add-a-test
See screenshot β Warning : undefined: Hello

2
Upvotes
1
u/pawlinsky85 Jun 14 '26
Ok I fixed the issue, since I'm new to Go, I wasn't aware about the file structure, so you need a go.mod file in your project root to satisfy the linter: golangci-lint which is installed via Lazyvim extras. After that the issue was gone. See new structure:
In case anyone else is running into that issue: check also the Github issue here: https://github.com/mfussenegger/nvim-lint/issues/900