Skip to content

Commit

Permalink
gopls/internal/settings: remove "allowImplicitNetworkAccess"
Browse files Browse the repository at this point in the history
This setting was slated for removal in gopls@v0.16. Nobody has
complained on the linked bug. Remove it.

Fixes golang/go#66861

Change-Id: I942dbd06755114a13ef097b4a57ffe169441e76f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/621877
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
  • Loading branch information
findleyr authored and gopherbot committed Oct 22, 2024
1 parent 6618569 commit 401eca0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 43 deletions.
19 changes: 10 additions & 9 deletions gopls/doc/release/v0.17.0.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Configuration Changes

The `fieldalignment` analyzer, previously disabled by default, has
been removed: it is redundant with the hover size/offset information
displayed by v0.16.0 and its diagnostics were confusing.

The kind (identifiers) of all of gopls' code actions have changed
to use more specific hierarchical names. For example, "Inline call"
has changed from `refactor.inline` to `refactor.inline.call`.
This allows clients to request particular code actions more precisely.
The user manual now includes the identifier in the documentation for each code action.
- The `fieldalignment` analyzer, previously disabled by default, has
been removed: it is redundant with the hover size/offset information
displayed by v0.16.0 and its diagnostics were confusing.
- The kind (identifiers) of all of gopls' code actions have changed
to use more specific hierarchical names. For example, "Inline call"
has changed from `refactor.inline` to `refactor.inline.call`.
This allows clients to request particular code actions more precisely.
The user manual now includes the identifier in the documentation for each code action.
- The experimental `allowImplicitNetworkAccess` setting is removed, following
its deprecation in gopls@v0.16.0. See golang/go#66861 for details.

# New features

Expand Down
11 changes: 0 additions & 11 deletions gopls/doc/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,6 @@ gopls has to do to keep your workspace up to date.

Default: `true`.

<a id='allowImplicitNetworkAccess'></a>
### `allowImplicitNetworkAccess bool`

**This setting is experimental and may be deleted.**

allowImplicitNetworkAccess disables GOPROXY=off, allowing implicit module
downloads rather than requiring user action. This option will eventually
be removed.

Default: `false`.

<a id='standaloneTags'></a>
### `standaloneTags []string`

Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/cache/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ func (s *Snapshot) GoCommandInvocation(allowNetwork bool, inv *gocommand.Invocat
)
inv.BuildFlags = slices.Clone(s.Options().BuildFlags)

if !allowNetwork && !s.Options().AllowImplicitNetworkAccess {
if !allowNetwork {
inv.Env = append(inv.Env, "GOPROXY=off")
}

Expand Down
13 changes: 0 additions & 13 deletions gopls/internal/doc/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,6 @@
"Status": "experimental",
"Hierarchy": "build"
},
{
"Name": "allowImplicitNetworkAccess",
"Type": "bool",
"Doc": "allowImplicitNetworkAccess disables GOPROXY=off, allowing implicit module\ndownloads rather than requiring user action. This option will eventually\nbe removed.\n",
"EnumKeys": {
"ValueType": "",
"Keys": null
},
"EnumValues": null,
"Default": "false",
"Status": "experimental",
"Hierarchy": "build"
},
{
"Name": "standaloneTags",
"Type": "[]string",
Expand Down
10 changes: 1 addition & 9 deletions gopls/internal/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ type BuildOptions struct {
// gopls has to do to keep your workspace up to date.
ExpandWorkspaceToModule bool `status:"experimental"`

// AllowImplicitNetworkAccess disables GOPROXY=off, allowing implicit module
// downloads rather than requiring user action. This option will eventually
// be removed.
AllowImplicitNetworkAccess bool `status:"experimental"`

// StandaloneTags specifies a set of build constraints that identify
// individual Go source files that make up the entire main package of an
// executable.
Expand Down Expand Up @@ -1138,10 +1133,7 @@ func (o *Options) setOne(name string, value any) error {
return setBool(&o.AnalysisProgressReporting, value)

case "allowImplicitNetworkAccess":
if err := setBool(&o.AllowImplicitNetworkAccess, value); err != nil {
return err
}
return softErrorf("gopls setting \"allowImplicitNetworkAccess\" is deprecated.\nPlease comment on https://go.dev/issue/66861 if this impacts your workflow.")
return deprecatedError("")

case "standaloneTags":
return setStringSlice(&o.StandaloneTags, value)
Expand Down

0 comments on commit 401eca0

Please sign in to comment.