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:
committed by
GitHub
parent
83fbad1a6b
commit
3355ecfbfd
@@ -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 {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user