Skip to content

Commit 7656d0d

Browse files
committed
chore(devtools): leave todos for deprecated pkgs
Signed-off-by: Dwi Siswanto <[email protected]>
1 parent 257f3b2 commit 7656d0d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

pkg/js/devtools/bindgen/generator.go

+10
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ func CreateTemplateData(directory string, packagePrefix string) (*TemplateData,
131131
return nil, errors.Wrap(err, "could not check package")
132132
}
133133

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.
134136
var pkgMain *ast.Package
135137
for _, p := range pkgs {
136138
pkgMain = p
@@ -187,6 +189,9 @@ func (d *TemplateData) InitNativeScripts() {
187189
}
188190

189191
// 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.
190195
func (d *TemplateData) gatherPackageData(pkg *ast.Package, data *TemplateData) {
191196
ast.Inspect(pkg, func(node ast.Node) bool {
192197
switch node := node.(type) {
@@ -242,6 +247,11 @@ func (d *TemplateData) gatherPackageData(pkg *ast.Package, data *TemplateData) {
242247
})
243248
}
244249

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.
245255
func identifyGenDecl(pkg *ast.Package, decl *ast.GenDecl, data *TemplateData) {
246256
for _, spec := range decl.Specs {
247257
switch spec := spec.(type) {

pkg/js/devtools/scrapefuncs/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ func main() {
5151
}); err != nil {
5252
panic(err)
5353
}
54+
55+
// TODO: ast.Package has been deprecated since Go 1.22 and an alternative
56+
// has been available since Go 1.0: use the type checker [go/types] instead.
5457
pkgs := map[string]*ast.Package{}
5558

5659
for _, dir := range dirList {

0 commit comments

Comments
 (0)