The Visit function was originally intended to allow the user to visit nodes
with an understanding of the path which edge was used to reach the node. This
was misguided because it implies the existence of an invariant that does not
exist; every edge into a node is passed to Visit as its node end points. This
does not happen because Visit is only called after the node being traverse to
is tested for having been visited, leading to surprising behaviour. So this
change makes Visit only consider the visited node.
The function that was originally intended to be provided by Visit is not given
by the Traverse function — previously EdgeFilter — which is called prior to
the node's visited status test. The node's visited status can be determined
via the walker's Visited method if needed. To avoid painting the edge visiting
method as purely a filter, it is renamed Traverse.
This is special cased because simple graph traversal is generally useful
and users my want to be able to travers graph-like types without
implementing all the methods on graph.Graph.
Add copyright header to doc.go
Keep original comment style (e.g. line comments and block comments).
Fix doc comments containing multiple line comments.
Remove vanity imports from all files except doc.go.
Fixes#12.
The source code of fixdocs is located at:
https://play.golang.org/p/7RtYLzldsO
Add copyright header to doc.go
Keep original comment style (e.g. line comments and block comments).
Fix doc comments containing multiple line comments.