diff --git a/internal/fetch/getters.go b/internal/fetch/getters.go index 13ae0b539..0fb7e0c39 100644 --- a/internal/fetch/getters.go +++ b/internal/fetch/getters.go @@ -523,7 +523,14 @@ func (g *goPackagesModuleGetter) Search(ctx context.Context, query string, limit continue } if f.Doc != nil { - //lint:ignore SA1019 TODO(jba) create a doc.Package + //lint:ignore SA1019 doc.Synopsis is correct here. + // The lint message warns that doc.Synopsis is deprecated in favor + // of Package.Synopsis. + // Package.Synopsis would display links on separate lines if the + // Package were initialized with a package's code and if the synopsis + // contained links. + // We don't have the code and we wouldn't want the extra lines if we did, + // so doc.Synopsis is a better choice. result.Synopsis = doc.Synopsis(f.Doc.Text()) } } diff --git a/internal/godoc/codec/generate.go b/internal/godoc/codec/generate.go index 8642550d7..8854d628c 100644 --- a/internal/godoc/codec/generate.go +++ b/internal/godoc/codec/generate.go @@ -437,7 +437,7 @@ const initialBody = ` // Code generated by the codec package. DO NOT EDIT. -//lint:file-ignore SA1019 TODO(jba): fix +//lint:file-ignore SA1019 go/doc uses *ast.Object, so we must preserve it. package «.Package» diff --git a/internal/godoc/codec/testdata/map.go b/internal/godoc/codec/testdata/map.go index db8952b9b..611b73068 100644 --- a/internal/godoc/codec/testdata/map.go +++ b/internal/godoc/codec/testdata/map.go @@ -4,7 +4,7 @@ // Code generated by the codec package. DO NOT EDIT. -//lint:file-ignore SA1019 TODO(jba): fix +//lint:file-ignore SA1019 go/doc uses *ast.Object, so we must preserve it. package somepkg diff --git a/internal/godoc/codec/testdata/slice.go b/internal/godoc/codec/testdata/slice.go index 63d145be7..abe002c73 100644 --- a/internal/godoc/codec/testdata/slice.go +++ b/internal/godoc/codec/testdata/slice.go @@ -4,7 +4,7 @@ // Code generated by the codec package. DO NOT EDIT. -//lint:file-ignore SA1019 TODO(jba): fix +//lint:file-ignore SA1019 go/doc uses *ast.Object, so we must preserve it. package somepkg diff --git a/internal/godoc/codec/testdata/struct.go b/internal/godoc/codec/testdata/struct.go index 0c5cf7f0d..d102fc95f 100644 --- a/internal/godoc/codec/testdata/struct.go +++ b/internal/godoc/codec/testdata/struct.go @@ -4,7 +4,7 @@ // Code generated by the codec package. DO NOT EDIT. -//lint:file-ignore SA1019 TODO(jba): fix +//lint:file-ignore SA1019 go/doc uses *ast.Object, so we must preserve it. package somepkg diff --git a/internal/godoc/dochtml/internal/render/render_test.go b/internal/godoc/dochtml/internal/render/render_test.go index 0514a4f64..483423db4 100644 --- a/internal/godoc/dochtml/internal/render/render_test.go +++ b/internal/godoc/dochtml/internal/render/render_test.go @@ -14,6 +14,10 @@ import ( "strings" ) +//lint:file-ignore SA1019 We only need the syntax tree. +// ast.NewPackage is deprecated in favor of go/types, but we don't want or need full +// type information here, just the syntax tree. We are only rendering documentation. + var pkgTime, fsetTime = mustLoadPackage("time") func mustLoadPackage(path string) (*doc.Package, *token.FileSet) { diff --git a/internal/godoc/encode_ast.gen.go b/internal/godoc/encode_ast.gen.go index c27463906..bc49f4d69 100644 --- a/internal/godoc/encode_ast.gen.go +++ b/internal/godoc/encode_ast.gen.go @@ -4,7 +4,7 @@ // Code generated by the codec package. DO NOT EDIT. -//lint:file-ignore SA1019 TODO(jba): fix +//lint:file-ignore SA1019 go/doc uses *ast.Object, so we must preserve it. package godoc diff --git a/internal/godoc/encode_test.go b/internal/godoc/encode_test.go index 05ed056cb..837d08422 100644 --- a/internal/godoc/encode_test.go +++ b/internal/godoc/encode_test.go @@ -188,7 +188,7 @@ func printNode(w io.Writer, root ast.Node) error { idx := len(seen) seen[x] = idx pr("%s#%d", ts, idx) - //lint:ignore SA1019 TODO(jba) remove ast.Object + //lint:ignore SA1019 go/doc uses *ast.Object, so we must preserve it. if obj, ok := x.(*ast.Object); ok { pr(" %s %s %v\n", obj.Name, obj.Kind, obj.Data) prValue(obj.Decl, depth+1)