@@ -388,6 +388,8 @@ func extractUniverseScope() {
388
388
}
389
389
390
390
// extractObjects extracts all objects declared in the given scope
391
+ // For more information on objects, see:
392
+ // https://github.com/golang/example/blob/master/gotypes/README.md#objects
391
393
func extractObjects (tw * trap.Writer , scope * types.Scope , scopeLabel trap.Label ) {
392
394
for _ , name := range scope .Names () {
393
395
obj := scope .Lookup (name )
@@ -440,6 +442,8 @@ func extractMethod(tw *trap.Writer, meth *types.Func) trap.Label {
440
442
}
441
443
442
444
// extractObject extracts a single object and emits it to the objects table.
445
+ // For more information on objects, see:
446
+ // https://github.com/golang/example/blob/master/gotypes/README.md#objects
443
447
func extractObject (tw * trap.Writer , obj types.Object , lbl trap.Label ) {
444
448
name := obj .Name ()
445
449
isBuiltin := obj .Parent () == types .Universe
@@ -487,6 +491,8 @@ func extractObject(tw *trap.Writer, obj types.Object, lbl trap.Label) {
487
491
}
488
492
489
493
// extractObjectTypes extracts type and receiver information for all objects
494
+ // For more information on objects, see:
495
+ // https://github.com/golang/example/blob/master/gotypes/README.md#objects
490
496
func extractObjectTypes (tw * trap.Writer ) {
491
497
// calling `extractType` on a named type will extract all methods defined
492
498
// on it, which will add new objects. Therefore we need to do this first
@@ -497,11 +503,13 @@ func extractObjectTypes(tw *trap.Writer) {
497
503
}
498
504
changed = tw .ForEachObject (emitObjectType )
499
505
if changed {
500
- log .Printf ("Warning: more objects were labeled while emitted object types" )
506
+ log .Printf ("Warning: more objects were labeled while emitting object types" )
501
507
}
502
508
}
503
509
504
510
// extractObjectType extracts type and receiver information for a given object
511
+ // For more information on objects, see:
512
+ // https://github.com/golang/example/blob/master/gotypes/README.md#objects
505
513
func extractObjectType (tw * trap.Writer , obj types.Object , lbl trap.Label ) {
506
514
if tp := obj .Type (); tp != nil {
507
515
extractType (tw , tp )
0 commit comments