Bump minimum Go version to 1.18 (#262)

This means we can use generics and various other things. I didn't use
any of them yet, this is just bumping the numbers. I added tests for
1.20, and fixed one small bug, I think caused by `go/packages` changes
therein. And I bumped the golangci-lint version too while I was in the
area.

Fixes #256, fixes #257.

I have:
- [x] Written a clear PR title and description (above)
- [x] Signed the [Khan Academy CLA](https://www.khanacademy.org/r/cla)
- [x] Added tests covering my changes, if applicable
- [x] Included a link to the issue fixed, if applicable
- [x] Included documentation, for new features
- [x] Added an entry to the changelog
This commit is contained in:
Ben Kraft
2023-04-08 16:48:34 -07:00
committed by GitHub
parent ff44aa07c1
commit 677fa94d30
8 changed files with 402 additions and 803 deletions
+2 -2
View File
@@ -127,7 +127,7 @@ func (c *Config) ValidateAndFillDefaults(baseDir string) error {
binding.Package)
}
mode := packages.NeedImports | packages.NeedTypes | packages.NeedTypesSizes
mode := packages.NeedDeps | packages.NeedTypes
pkgs, err := packages.Load(&packages.Config{
Mode: mode,
}, binding.Package)
@@ -141,7 +141,7 @@ func (c *Config) ValidateAndFillDefaults(baseDir string) error {
for _, pkg := range pkgs {
p := pkg.Types
if p == nil || p.Scope() == nil {
if p == nil || p.Scope() == nil || p.Scope().Len() == 0 {
return errorf(nil, "unable to bind package %s: no types found", binding.Package)
}