@@ -43,6 +43,20 @@ import (
43
43
// ID and Errors (if present) will always be filled.
44
44
// [Load] may return more information than requested.
45
45
//
46
+ // The Mode flag is a union of several bits named NeedName,
47
+ // NeedFiles, and so on, each of which determines whether
48
+ // a given field of Package (Name, Files, etc) should be
49
+ // populated.
50
+ //
51
+ // For convenience, we provide named constants for the most
52
+ // common combinations of Need flags:
53
+ //
54
+ // [LoadFiles] lists of files in each package
55
+ // [LoadImports] ... plus imports
56
+ // [LoadTypes] ... plus type information
57
+ // [LoadSyntax] ... plus type-annotated syntax
58
+ // [LoadAllSyntax] ... for all dependencies
59
+ //
46
60
// Unfortunately there are a number of open bugs related to
47
61
// interactions among the LoadMode bits:
48
62
// - https://github.com/golang/go/issues/56633
@@ -109,33 +123,18 @@ const (
109
123
110
124
const (
111
125
// LoadFiles loads the name and file names for the initial packages.
112
- //
113
- // Deprecated: LoadFiles exists for historical compatibility
114
- // and should not be used. Please directly specify the needed fields using the Need values.
115
126
LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles
116
127
117
128
// LoadImports loads the name, file names, and import mapping for the initial packages.
118
- //
119
- // Deprecated: LoadImports exists for historical compatibility
120
- // and should not be used. Please directly specify the needed fields using the Need values.
121
129
LoadImports = LoadFiles | NeedImports
122
130
123
131
// LoadTypes loads exported type information for the initial packages.
124
- //
125
- // Deprecated: LoadTypes exists for historical compatibility
126
- // and should not be used. Please directly specify the needed fields using the Need values.
127
132
LoadTypes = LoadImports | NeedTypes | NeedTypesSizes
128
133
129
134
// LoadSyntax loads typed syntax for the initial packages.
130
- //
131
- // Deprecated: LoadSyntax exists for historical compatibility
132
- // and should not be used. Please directly specify the needed fields using the Need values.
133
135
LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo
134
136
135
137
// LoadAllSyntax loads typed syntax for the initial packages and all dependencies.
136
- //
137
- // Deprecated: LoadAllSyntax exists for historical compatibility
138
- // and should not be used. Please directly specify the needed fields using the Need values.
139
138
LoadAllSyntax = LoadSyntax | NeedDeps
140
139
141
140
// Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile.
0 commit comments