From 401eca0e4a8128a5a5ba118ff3e116843fec424a Mon Sep 17 00:00:00 2001 From: Rob Findley Date: Tue, 22 Oct 2024 20:42:04 +0000 Subject: [PATCH] gopls/internal/settings: remove "allowImplicitNetworkAccess" 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 Auto-Submit: Robert Findley Reviewed-by: Alan Donovan --- gopls/doc/release/v0.17.0.md | 19 ++++++++++--------- gopls/doc/settings.md | 11 ----------- gopls/internal/cache/snapshot.go | 2 +- gopls/internal/doc/api.json | 13 ------------- gopls/internal/settings/settings.go | 10 +--------- 5 files changed, 12 insertions(+), 43 deletions(-) diff --git a/gopls/doc/release/v0.17.0.md b/gopls/doc/release/v0.17.0.md index 5b26cea525d..19fc4bf838f 100644 --- a/gopls/doc/release/v0.17.0.md +++ b/gopls/doc/release/v0.17.0.md @@ -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 diff --git a/gopls/doc/settings.md b/gopls/doc/settings.md index db6092a980c..135fcca70af 100644 --- a/gopls/doc/settings.md +++ b/gopls/doc/settings.md @@ -119,17 +119,6 @@ gopls has to do to keep your workspace up to date. Default: `true`. - -### `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`. - ### `standaloneTags []string` diff --git a/gopls/internal/cache/snapshot.go b/gopls/internal/cache/snapshot.go index d9852ace1f6..472fe263598 100644 --- a/gopls/internal/cache/snapshot.go +++ b/gopls/internal/cache/snapshot.go @@ -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") } diff --git a/gopls/internal/doc/api.json b/gopls/internal/doc/api.json index b076abd26b0..6b8873cf817 100644 --- a/gopls/internal/doc/api.json +++ b/gopls/internal/doc/api.json @@ -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", diff --git a/gopls/internal/settings/settings.go b/gopls/internal/settings/settings.go index 5d3d0cddceb..3d97a22cafe 100644 --- a/gopls/internal/settings/settings.go +++ b/gopls/internal/settings/settings.go @@ -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. @@ -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)