@@ -61,14 +61,14 @@ func RenderPackageDoc(pkg *cache.Package, posURL func(filename string, line, col
61
61
// The only loss is doc.classifyExamples.
62
62
// TODO(adonovan): simulate that too.
63
63
fileMap := make (map [string ]* ast.File )
64
- for _ , f := range pkg .GetSyntax () {
64
+ for _ , f := range pkg .Syntax () {
65
65
fileMap [pkg .FileSet ().File (f .Pos ()).Name ()] = f
66
66
}
67
67
astpkg := & ast.Package {
68
- Name : pkg .GetTypes ().Name (),
68
+ Name : pkg .Types ().Name (),
69
69
Files : fileMap ,
70
70
}
71
- docpkg := doc .New (astpkg , pkg .GetTypes ().Path (), doc .PreserveAST )
71
+ docpkg := doc .New (astpkg , pkg .Types ().Path (), doc .PreserveAST )
72
72
73
73
// Ensure doc links (e.g. "[fmt.Println]") become valid links.
74
74
docpkg .Printer ().DocLinkURL = func (link * comment.DocLink ) string {
@@ -127,7 +127,7 @@ function httpGET(url) {
127
127
128
128
// linkify returns the appropriate URL (if any) for an identifier.
129
129
linkify := func (id * ast.Ident ) protocol.URI {
130
- if obj , ok := pkg .GetTypesInfo ().Uses [id ]; ok && obj .Pkg () != nil {
130
+ if obj , ok := pkg .TypesInfo ().Uses [id ]; ok && obj .Pkg () != nil {
131
131
// imported package name?
132
132
if pkgname , ok := obj .(* types.PkgName ); ok {
133
133
// TODO(adonovan): do this for Defs of PkgName too.
@@ -136,7 +136,7 @@ function httpGET(url) {
136
136
137
137
// package-level symbol?
138
138
if obj .Parent () == obj .Pkg ().Scope () {
139
- if obj .Pkg () == pkg .GetTypes () {
139
+ if obj .Pkg () == pkg .Types () {
140
140
return "#" + obj .Name () // intra-package ref
141
141
} else {
142
142
return pkgURL (PackagePath (obj .Pkg ().Path ()), obj .Name ())
@@ -224,21 +224,21 @@ function httpGET(url) {
224
224
225
225
// pkgRelative qualifies types by package name alone
226
226
pkgRelative := func (other * types.Package ) string {
227
- if pkg .GetTypes () == other {
227
+ if pkg .Types () == other {
228
228
return "" // same package; unqualified
229
229
}
230
230
return other .Name ()
231
231
}
232
232
233
233
// package name
234
- fmt .Fprintf (& buf , "<h1>Package %s</h1>\n " , pkg .GetTypes ().Name ())
234
+ fmt .Fprintf (& buf , "<h1>Package %s</h1>\n " , pkg .Types ().Name ())
235
235
236
236
// import path
237
- fmt .Fprintf (& buf , "<pre class='code'>import %q</pre>\n " , pkg .GetTypes ().Path ())
237
+ fmt .Fprintf (& buf , "<pre class='code'>import %q</pre>\n " , pkg .Types ().Path ())
238
238
239
239
// link to same package in pkg.go.dev
240
240
fmt .Fprintf (& buf , "<div><a href=%q title='View in pkg.go.dev'><img id='pkgsite' src='/assets/go-logo-blue.svg'/></a>\n " ,
241
- "https://pkg.go.dev/" + string (pkg .GetTypes ().Path ()))
241
+ "https://pkg.go.dev/" + string (pkg .Types ().Path ()))
242
242
243
243
// package doc
244
244
fmt .Fprintf (& buf , "<div class='comment'>%s</div>\n " , docpkg .HTML (docpkg .Doc ))
@@ -252,7 +252,7 @@ function httpGET(url) {
252
252
if len (docpkg .Vars ) > 0 {
253
253
fmt .Fprintf (& buf , "<li><a href='#hdr-Variables'>Variables</a></li>\n " )
254
254
}
255
- scope := pkg .GetTypes ().Scope ()
255
+ scope := pkg .Types ().Scope ()
256
256
for _ , fn := range docpkg .Funcs {
257
257
obj := scope .Lookup (fn .Name ).(* types.Func )
258
258
fmt .Fprintf (& buf , "<li><a href='#%s'>%s</a></li>\n " ,
0 commit comments