@@ -131,6 +131,8 @@ func CreateTemplateData(directory string, packagePrefix string) (*TemplateData,
131
131
return nil , errors .Wrap (err , "could not check package" )
132
132
}
133
133
134
+ // TODO: ast.Package has been deprecated since Go 1.22 and an alternative
135
+ // has been available since Go 1.0: use the type checker [go/types] instead.
134
136
var pkgMain * ast.Package
135
137
for _ , p := range pkgs {
136
138
pkgMain = p
@@ -187,6 +189,9 @@ func (d *TemplateData) InitNativeScripts() {
187
189
}
188
190
189
191
// gatherPackageData gathers data about the package
192
+ //
193
+ // TODO: ast.Package has been deprecated since Go 1.22 and an alternative has
194
+ // been available since Go 1.0: use the type checker [go/types] instead.
190
195
func (d * TemplateData ) gatherPackageData (pkg * ast.Package , data * TemplateData ) {
191
196
ast .Inspect (pkg , func (node ast.Node ) bool {
192
197
switch node := node .(type ) {
@@ -242,6 +247,11 @@ func (d *TemplateData) gatherPackageData(pkg *ast.Package, data *TemplateData) {
242
247
})
243
248
}
244
249
250
+ // identifyGenDecl identifies and processes general declarations in the AST,
251
+ // handling exported variables, interfaces and structs.
252
+ //
253
+ // TODO: ast.Package has been deprecated since Go 1.22 and an alternative has
254
+ // been available since Go 1.0: use the type checker [go/types] instead.
245
255
func identifyGenDecl (pkg * ast.Package , decl * ast.GenDecl , data * TemplateData ) {
246
256
for _ , spec := range decl .Specs {
247
257
switch spec := spec .(type ) {
0 commit comments