Skip to content

Commit

Permalink
Add more internal documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
picatz committed Jan 10, 2024
1 parent 55990d4 commit 0072e64
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions callgraphutil/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func WriteCSV(w io.Writer, g *callgraph.Graph) error {
return nil
}

// nodeInfo is a struct that contains information about a callgraph.Node used
// to generate CSV output.
type nodeInfo struct {
pkgPath string
pkgGoVersion string
Expand All @@ -72,6 +74,7 @@ type nodeInfo struct {
pkgFuncSignature string
}

// CSV returns single record for the node.
func (n *nodeInfo) CSV() []string {
return []string{
n.pkgPath,
Expand All @@ -83,6 +86,7 @@ func (n *nodeInfo) CSV() []string {
}
}

// getNodeInfo returns a nodeInfo struct for the given callgraph.Node.
func getNodeInfo(n *callgraph.Node) (*nodeInfo, error) {
info := &nodeInfo{
pkgPath: "unknown",
Expand Down

0 comments on commit 0072e64

Please sign in to comment.