From 3355ecfbfdb404f16ffc05decb5b4e63d4c57989 Mon Sep 17 00:00:00 2001 From: Michael McLoughlin Date: Thu, 13 Jun 2019 11:20:49 -0700 Subject: [PATCH] lint: stop using deprecated go/packages api (#87) The packages.Load* constants have been deprecated in favor of packages.Need*. --- build/context.go | 2 +- gotypes/signature_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/context.go b/build/context.go index fb00b4e..d1a1ec5 100644 --- a/build/context.go +++ b/build/context.go @@ -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. func (c *Context) Package(path string) { cfg := &packages.Config{ - Mode: packages.LoadAllSyntax, + Mode: packages.NeedTypes | packages.NeedDeps, } pkgs, err := packages.Load(cfg, path) if err != nil { diff --git a/gotypes/signature_test.go b/gotypes/signature_test.go index 5c8e655..a90f652 100644 --- a/gotypes/signature_test.go +++ b/gotypes/signature_test.go @@ -51,7 +51,7 @@ func TestLookupSignatureErrors(t *testing.T) { func LoadPackageTypes(t *testing.T, path string) *types.Package { t.Helper() cfg := &packages.Config{ - Mode: packages.LoadTypes, + Mode: packages.NeedTypes, } pkgs, err := packages.Load(cfg, path) if err != nil {