Skip to content

Commit

Permalink
Stop displaying the slice keys in the test main.
Browse files Browse the repository at this point in the history
They used to be map keys, so it made sense, but now they're just
arbitrary ints.
  • Loading branch information
korfuri committed Jul 9, 2017
1 parent 5ffe092 commit 15abcb9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,28 @@ func main() {
}

log.Printf("Here are the uses of objects in `goref`:\n")
for pos, ref := range m.Packages["github.com/korfuri/goref"].InRefs {
log.Printf(" - %s %s\n", pos, ref)
for _, ref := range m.Packages["github.com/korfuri/goref"].InRefs {
log.Printf(" - %s\n", ref)
}

log.Printf("Here is where `goref`.`InRefs` is used:\n")
for pos, ref := range m.Packages["github.com/korfuri/goref"].InRefs {
for _, ref := range m.Packages["github.com/korfuri/goref"].InRefs {
if ref.ToIdent == "InRefs" {
log.Printf(" - %s\n", pos)
log.Printf(" - %s\n", ref)
}
}

log.Printf("Here are the uses of objects in `log` by `main`:\n")
for pos, ref := range m.Packages["log"].InRefs {
for _, ref := range m.Packages["log"].InRefs {
if ref.FromPackage == m.Packages["github.com/korfuri/goref/main"] {
log.Printf(" - %s %s\n", pos, ref)
log.Printf(" - %s\n", ref)
}
}

log.Printf("Who implements `log.Stringer`?\n")
for pos, ref := range m.Packages["fmt"].InRefs {
for _, ref := range m.Packages["fmt"].InRefs {
if ref.ToIdent == "Stringer" && ref.RefType == goref.Implementation {
log.Printf(" - implemented at %s by %s\n", pos, ref)
log.Printf(" - %s\n", ref)
}
}

Expand Down

0 comments on commit 15abcb9

Please sign in to comment.