Skip to content

Commit

Permalink
add go.work and remove Gopkg.toml as Go roots (helix-editor#6884)
Browse files Browse the repository at this point in the history
Gopkg.toml was used by dep, Go's original dependency management tool.
It was an experiment that culminated in official and built-in support
for Go modules in mid 2018, and dep was deprecated and archived
in mid 2020 per golang/go#38158.

Now, in 2023, Gopkg.toml files are incredibly rare in actively developed
Go projects, as people use go.mod with Go modules instead.

While here, also add go.work as a root file, since that is used by
Go module workspaces, added in Go 1.18 in early 2022.
gopls or commands like `go build` work inside either go.work or go.mod.
These two root files are the same ones used by gopls integrations with
other editors like vim or neovim.
  • Loading branch information
mvdan authored and Schuyler Mortimer committed Jul 10, 2024
1 parent a609164 commit 9a1026d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ name = "go"
scope = "source.go"
injection-regex = "go"
file-types = ["go"]
roots = ["Gopkg.toml", "go.mod"]
roots = ["go.work", "go.mod"]
auto-format = true
comment-token = "//"
language-server = { command = "gopls" }
Expand Down

0 comments on commit 9a1026d

Please sign in to comment.