lint: stop using deprecated go/packages api (#87)

The packages.Load* constants have been deprecated in favor of packages.Need*.
This commit is contained in:
Michael McLoughlin
2019-06-13 11:20:49 -07:00
committed by GitHub
parent 83fbad1a6b
commit 3355ecfbfd
2 changed files with 2 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ func NewContext() *Context {
// Package sets the package the generated file will belong to. Required to be able to reference types in the package. // Package sets the package the generated file will belong to. Required to be able to reference types in the package.
func (c *Context) Package(path string) { func (c *Context) Package(path string) {
cfg := &packages.Config{ cfg := &packages.Config{
Mode: packages.LoadAllSyntax, Mode: packages.NeedTypes | packages.NeedDeps,
} }
pkgs, err := packages.Load(cfg, path) pkgs, err := packages.Load(cfg, path)
if err != nil { if err != nil {

View File

@@ -51,7 +51,7 @@ func TestLookupSignatureErrors(t *testing.T) {
func LoadPackageTypes(t *testing.T, path string) *types.Package { func LoadPackageTypes(t *testing.T, path string) *types.Package {
t.Helper() t.Helper()
cfg := &packages.Config{ cfg := &packages.Config{
Mode: packages.LoadTypes, Mode: packages.NeedTypes,
} }
pkgs, err := packages.Load(cfg, path) pkgs, err := packages.Load(cfg, path)
if err != nil { if err != nil {