go/packages: undeprecate Load* style flags

Updates golang/go#70470

Change-Id: Ia254b993b301fcc708d07b3773fad31a971c5997
Reviewed-on: https://go-review.googlesource.com/c/tools/+/630435
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
xieyuschen 2024-11-21 13:55:51 +08:00 коммит произвёл Gopher Robot
Родитель 9dff42e52e
Коммит c3a6283c06
1 изменённых файлов: 14 добавлений и 15 удалений

Просмотреть файл

@ -43,6 +43,20 @@ import (
// ID and Errors (if present) will always be filled. // ID and Errors (if present) will always be filled.
// [Load] may return more information than requested. // [Load] may return more information than requested.
// //
// The Mode flag is a union of several bits named NeedName,
// NeedFiles, and so on, each of which determines whether
// a given field of Package (Name, Files, etc) should be
// populated.
//
// For convenience, we provide named constants for the most
// common combinations of Need flags:
//
// [LoadFiles] lists of files in each package
// [LoadImports] ... plus imports
// [LoadTypes] ... plus type information
// [LoadSyntax] ... plus type-annotated syntax
// [LoadAllSyntax] ... for all dependencies
//
// Unfortunately there are a number of open bugs related to // Unfortunately there are a number of open bugs related to
// interactions among the LoadMode bits: // interactions among the LoadMode bits:
// - https://github.com/golang/go/issues/56633 // - https://github.com/golang/go/issues/56633
@ -109,33 +123,18 @@ const (
const ( const (
// LoadFiles loads the name and file names for the initial packages. // LoadFiles loads the name and file names for the initial packages.
//
// Deprecated: LoadFiles exists for historical compatibility
// and should not be used. Please directly specify the needed fields using the Need values.
LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles
// LoadImports loads the name, file names, and import mapping for the initial packages. // LoadImports loads the name, file names, and import mapping for the initial packages.
//
// Deprecated: LoadImports exists for historical compatibility
// and should not be used. Please directly specify the needed fields using the Need values.
LoadImports = LoadFiles | NeedImports LoadImports = LoadFiles | NeedImports
// LoadTypes loads exported type information for the initial packages. // LoadTypes loads exported type information for the initial packages.
//
// Deprecated: LoadTypes exists for historical compatibility
// and should not be used. Please directly specify the needed fields using the Need values.
LoadTypes = LoadImports | NeedTypes | NeedTypesSizes LoadTypes = LoadImports | NeedTypes | NeedTypesSizes
// LoadSyntax loads typed syntax for the initial packages. // LoadSyntax loads typed syntax for the initial packages.
//
// Deprecated: LoadSyntax exists for historical compatibility
// and should not be used. Please directly specify the needed fields using the Need values.
LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo
// LoadAllSyntax loads typed syntax for the initial packages and all dependencies. // LoadAllSyntax loads typed syntax for the initial packages and all dependencies.
//
// Deprecated: LoadAllSyntax exists for historical compatibility
// and should not be used. Please directly specify the needed fields using the Need values.
LoadAllSyntax = LoadSyntax | NeedDeps LoadAllSyntax = LoadSyntax | NeedDeps
// Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile. // Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile.