Skip to content

Commit

Permalink
add comment and remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
steviebps committed Oct 9, 2021
1 parent 6e7b240 commit 7a2f940
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions pkg/chamber.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,6 @@ type Chamber struct {
Children []*Chamber `json:"children,omitempty"`
}

// // EncodeWith takes a writer and encodes JSON to that writer
// func (c *Chamber) EncodeWith(w io.Writer, pretty bool) error {
// enc := json.NewEncoder(w)
// if pretty {
// enc.SetIndent("", " ")
// }

// if err := enc.Encode(c); err != nil {
// return err
// }

// return nil
// }

// FindByName will return the first child or nth-grandchild with the matching name. BFS.
func (c *Chamber) FindByName(name string) *Chamber {
queue := make([]*Chamber, 0)
Expand Down Expand Up @@ -77,6 +63,8 @@ func (c *Chamber) TraverseAndBuild(callback func(Chamber) bool) {
}
}

// GetToggleValue returns the toggle with the specified toggleName at the specified version.
// Will return nil if the toggle does not exist
func (c *Chamber) GetToggleValue(toggleName string, version string) interface{} {
var t *Toggle
var ok bool
Expand All @@ -85,7 +73,7 @@ func (c *Chamber) GetToggleValue(toggleName string, version string) interface{}
return nil
}

return t.GetValue(version)
return t.GetValueAt(version)
}

// UnmarshalJSON Custom UnmarshalJSON method for validating Chamber
Expand Down

0 comments on commit 7a2f940

Please sign in to comment.