Skip to content

Commit

Permalink
Fix package name in golangfinder and file nameing
Browse files Browse the repository at this point in the history
  • Loading branch information
emilwareus committed Mar 13, 2024
1 parent ada7268 commit 961aef1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/callgraph/finder/golangfinder/finder.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package golanfinder
package golangfinder

import (
"go/ast"
Expand Down
2 changes: 1 addition & 1 deletion internal/callgraph/finder/golangfinder/finder_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package golanfinder
package golangfinder

import (
"path/filepath"
Expand Down
4 changes: 2 additions & 2 deletions internal/callgraph/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type Edge struct {
CallLine int
}

// We store the graph in reverse, so child -> parent.
// This increases the speed of the graph traversal.
type Node struct {
Filename string
Name string
Expand Down Expand Up @@ -100,13 +102,11 @@ func (cg *CallGraph) GetNode(symbol string) *Node {
func (cg *CallGraph) ToBytes() ([]byte, error) {
output := []byte{}

// Get the keys of cg.Nodes
keys := make([]string, 0, len(cg.Nodes))
for key := range cg.Nodes {
keys = append(keys, key)
}

// Sort the keys
sort.Strings(keys)

output = append(output, []byte("[")...)
Expand Down
4 changes: 2 additions & 2 deletions internal/callgraph/strategy/strategy_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/debricked/cli/internal/callgraph/cgexec"
conf "github.com/debricked/cli/internal/callgraph/config"
golanfinder "github.com/debricked/cli/internal/callgraph/finder/golangfinder"
golangfinder "github.com/debricked/cli/internal/callgraph/finder/golangfinder"
"github.com/debricked/cli/internal/callgraph/finder/javafinder"
"github.com/debricked/cli/internal/callgraph/language/golang"
java "github.com/debricked/cli/internal/callgraph/language/java11"
Expand All @@ -27,7 +27,7 @@ func (sf Factory) Make(config conf.IConfig, paths []string, exclusions []string,
case java.Name:
return java.NewStrategy(config, paths, exclusions, javafinder.JavaFinder{}, ctx), nil
case golang.Name:
return golang.NewStrategy(config, paths, exclusions, golanfinder.GolangFinder{}, ctx), nil
return golang.NewStrategy(config, paths, exclusions, golangfinder.GolangFinder{}, ctx), nil
default:
return nil, fmt.Errorf("failed to make strategy from %s", name)
}
Expand Down

0 comments on commit 961aef1

Please sign in to comment.