community/gopls: upgrade to 0.16.1
https://github.com/golang/tools/releases/tag/gopls%2Fv0.16.1
We have to add the !check
option because the test
directory (see cd test
in
check function) was removed in v0.15.0: https://github.com/golang/tools/commit/00ec6daca3ac
I tried using go test "$builddir"/...
in the check function, but that yielded
many test failures for very unclear reasons. For example:
--- FAIL: TestFreeRefs (0.00s)
--- FAIL: TestFreeRefs/file2.go (0.00s)
freesymbols_test.go:107: file2.go:1:19: could not import fmt (can't find import: "fmt": cannot find package "fmt" in any of:
($GOROOT not set)
/home/foo/go/src/fmt (from $GOPATH))
freesymbols_test.go:107: file2.go:1:43: x declared and not used
freesymbols_test.go:128: (-want +got)
[]string{
- "file pkgname fmt.Stringer",
+ "file pkgname fmt",
}
--- FAIL: TestFreeRefs/file4.go (0.00s)
freesymbols_test.go:107: file4.go:1:19: could not import bytes (can't find import: "bytes": cannot find package "bytes" in any of:
($GOROOT not set)
/home/foo/go/src/bytes (from $GOPATH))
freesymbols_test.go:128: (-want +got)
[]string{
- "local var buf.WriteByte",
+ "local var buf",
- "local var buf.WriteString",
+ "local var buf",
}
--- FAIL: TestFreeRefs/file5.go (0.00s)
freesymbols_test.go:107: file5.go:1:21: could not import errors (can't find import: "errors": cannot find package "errors" in any of:
($GOROOT not set)
/home/foo/go/src/errors (from $GOPATH))
freesymbols_test.go:107: file5.go:1:41: undefined: New
freesymbols_test.go:128: (-want +got)
[]string(
- {"file pkgname errors.New"},
+ nil,
)
--- FAIL: TestFreeRefs/file6.go (0.00s)
freesymbols_test.go:107: file6.go:1:19: could not import net/url (can't find import: "net/url": cannot find package "net/url" in any of:
($GOROOT not set)
/home/foo/go/src/net/url (from $GOPATH))
freesymbols_test.go:128: (-want +got)
[]string{
- "file pkgname url.URL",
+ "file pkgname url",
}
--- FAIL: TestFreeRefs/file7.go (0.00s)
freesymbols_test.go:107: file7.go:1:21: could not import net/url (can't find import: "net/url": cannot find package "net/url" in any of:
($GOROOT not set)
/home/foo/go/src/net/url (from $GOPATH))
freesymbols_test.go:107: file7.go:1:41: undefined: URL
freesymbols_test.go:128: (-want +got)
[]string(
- {"file pkgname url.URL"},
+ nil,
)
--- FAIL: TestFreeRefs/file9.go (0.00s)
freesymbols_test.go:107: file9.go:1:19: could not import go/build (can't find import: "go/build": cannot find package "go/build" in any of:
($GOROOT not set)
/home/foo/go/src/go/build (from $GOPATH))
freesymbols_test.go:128: (-want +got)
[]string{
- "file pkgname build.Default.GOOS",
+ "file pkgname build",
}
FAIL
FAIL golang.org/x/tools/gopls/internal/golang 0.045s
The fmt
, byte
, errors
, etc. packages are all a part of the golang standard
library, so I'm not sure what the problem is.
Edited by edwargix