Skip to content

Commit

Permalink
internal/lsp: remove unused parameters from moduleAtVersion
Browse files Browse the repository at this point in the history
Change-Id: I16ed074188fa5f670894778a89cea1a500ec5c7f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/397416
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Cherry Mui <cherryyz@google.com>
  • Loading branch information
Dylan Le authored and findleyr committed Apr 4, 2022
1 parent 7d125fe commit ff66cbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/lsp/link.go
Expand Up @@ -137,7 +137,7 @@ func goLinks(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle
if view.IsGoPrivatePath(target) {
continue
}
if mod, version, ok := moduleAtVersion(ctx, snapshot, target, pkg); ok && strings.ToLower(view.Options().LinkTarget) == "pkg.go.dev" {
if mod, version, ok := moduleAtVersion(target, pkg); ok && strings.ToLower(view.Options().LinkTarget) == "pkg.go.dev" {
target = strings.Replace(target, mod, mod+"@"+version, 1)
}
// Account for the quotation marks in the positions.
Expand Down Expand Up @@ -170,7 +170,7 @@ func goLinks(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle
return links, nil
}

func moduleAtVersion(ctx context.Context, snapshot source.Snapshot, target string, pkg source.Package) (string, string, bool) {
func moduleAtVersion(target string, pkg source.Package) (string, string, bool) {
impPkg, err := pkg.GetImport(target)
if err != nil {
return "", "", false
Expand Down

0 comments on commit ff66cbe

Please sign in to comment.