Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit 4582d06

Browse files
authored
Add build tags to make the project compatible with gopls (#470)
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.
1 parent b54ce38 commit 4582d06

22 files changed

+49
-5
lines changed

examples/countrylist.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

examples/cursor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

examples/inputfilesuggestion.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

examples/longlist.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

examples/longmulti.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

examples/longmultikeepfilter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

examples/map.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

examples/password.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

examples/select_description.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

examples/simple.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build ignore
2+
13
package main
24

35
import (

0 commit comments

Comments
 (0)