Skip to content

Commit 5299dcb

Browse files
committed
gopls/internal/settings: fix misleading error messages
The deprecatedError helper constructs a specifically formatted error string suggesting a replacement. Certain deprecations were misusing the API, resulting in nonsensical error messages. Change-Id: Ic72bf608b5b2e97baf75c192a49fd4181d7800b2 Reviewed-on: https://go-review.googlesource.com/c/tools/+/651695 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent 3d7c2e2 commit 5299dcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gopls/internal/settings/settings.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,15 +1116,15 @@ func (o *Options) setOne(name string, value any) (applied []CounterPath, _ error
11161116
return nil, err
11171117
}
11181118
if o.Analyses["fieldalignment"] {
1119-
return counts, deprecatedError("the 'fieldalignment' analyzer was removed in gopls/v0.17.0; instead, hover over struct fields to see size/offset information (https://go.dev/issue/66861)")
1119+
return counts, &SoftError{"the 'fieldalignment' analyzer was removed in gopls/v0.17.0; instead, hover over struct fields to see size/offset information (https://go.dev/issue/66861)"}
11201120
}
11211121
return counts, nil
11221122

11231123
case "hints":
11241124
return setBoolMap(&o.Hints, value)
11251125

11261126
case "annotations":
1127-
return nil, deprecatedError("the 'annotations' setting was removed in gopls/v0.18.0; all compiler optimization details are now shown")
1127+
return nil, &SoftError{"the 'annotations' setting was removed in gopls/v0.18.0; all compiler optimization details are now shown"}
11281128

11291129
case "vulncheck":
11301130
return setEnum(&o.Vulncheck, value,

0 commit comments

Comments
 (0)