Skip to content

Commit

Permalink
minor public func command change
Browse files Browse the repository at this point in the history
  • Loading branch information
sontrinh16 committed Dec 15, 2023
1 parent b523182 commit f910bcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Tree interface {
// The keys of this map should be kebab cased. E.g. "default-tree"
var treeFns = sync.Map{}

// Must be called in the init function
// RegisterTree must be called in the init function
func RegisterTree(treeName string, treeConstructor TreeConstructorFn) error {
if _, ok := treeFns.Load(treeName); ok {
return fmt.Errorf("%s already registered", treeName)
Expand All @@ -37,7 +37,7 @@ func RegisterTree(treeName string, treeConstructor TreeConstructorFn) error {
return nil
}

// Get tree constructor function by tree name from the global map registry
// TreeFn get tree constructor function by tree name from the global map registry
func TreeFn(treeName string) (TreeConstructorFn, error) {
var treeFn TreeConstructorFn
v, ok := treeFns.Load(treeName)
Expand Down

0 comments on commit f910bcf

Please sign in to comment.