The gopls deamon for text editor integrations used to complain about the main() function being redeclared across multiple package main files that share the same directory. This is because these individual scripts were meant to be run with go run path/to/file.go instead of being built as a binary.
The latest gopls release supports recognizing files that are meant as individual runnable scripts, but they must be tagged with a build tag that makes them otherwise ignored.
The gopls deamon for text editor integrations used to complain about the
main()
function being redeclared across multiplepackage main
files that share the same directory. This is because these individual scripts were meant to be run withgo run path/to/file.go
instead of being built as a binary.The latest gopls release supports recognizing files that are meant as individual runnable scripts, but they must be tagged with a build tag that makes them otherwise ignored.