From c813195dfc87793736f98567c822867c7d78e300 Mon Sep 17 00:00:00 2001 From: Adrian Hesketh Date: Sat, 24 Aug 2024 11:18:31 +0100 Subject: [PATCH] fix: find gopls if not in path, fixes #895 --- .version | 2 +- cmd/templ/lspcmd/pls/main.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.version b/.version index 732b01eeb..6d5f17400 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.2.771 \ No newline at end of file +0.2.773 \ No newline at end of file diff --git a/cmd/templ/lspcmd/pls/main.go b/cmd/templ/lspcmd/pls/main.go index 3986e76e3..06ba7477c 100644 --- a/cmd/templ/lspcmd/pls/main.go +++ b/cmd/templ/lspcmd/pls/main.go @@ -37,12 +37,11 @@ func FindGopls() (location string, err error) { executableName = "gopls.exe" } - executableName, err = exec.LookPath(executableName) + pathLocation, err := exec.LookPath(executableName) if err == nil { // Found on the path. - return executableName, nil + return pathLocation, nil } - // Unexpected error. if !errors.Is(err, exec.ErrNotFound) { return "", fmt.Errorf("unexpected error looking for gopls: %w", err)