Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add go.work and remove Gopkg.toml as Go roots #6884

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

mvdan
Copy link
Contributor

@mvdan mvdan commented Apr 26, 2023

(see commit message)

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.
Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable but why remove Gopkg.toml? It doesn't seem to cause any adverse affects and would keep backwards comparability with older projects

@mvdan
Copy link
Contributor Author

mvdan commented Apr 26, 2023

I couldn't find another major editor that still looks for the file. And dep hasn't been maintained for over four years now, so it's unlikely that it has worked for some time. Most importantly: this is to determine the workspace root for gopls, and gopls only supports Go modules, so I see even less reason for any form of optimistic backwards compatibility :)

@pascalkuthe
Copy link
Member

pascalkuthe commented Apr 26, 2023

Ah if gopls doesn't support this then it definitly makes sense to remove this 👍

@archseer archseer merged commit 488707c into helix-editor:master Apr 26, 2023
@mvdan mvdan deleted the go-roots branch April 30, 2023 12:58
Triton171 pushed a commit to Triton171/helix that referenced this pull request Jun 18, 2023
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.
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
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.
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants