Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
steviebps committed Jun 27, 2023
1 parent 0a220b1 commit 1603c19
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pkg/chamber.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package realm

import (
"errors"
"sync"
)

// Chamber is a struct that holds metadata and toggles
type Chamber struct {
Toggles map[string]*OverrideableToggle `json:"toggles" validate:"required"`
Toggles map[string]*OverrideableToggle `json:"toggles"`
lock *sync.RWMutex
}

Expand All @@ -23,15 +22,6 @@ func (c *Chamber) InheritWith(inherited map[string]*OverrideableToggle) {
}
}

// UnmarshalJSON Custom UnmarshalJSON method for validating the Chamber
func (c *Chamber) UnmarshalJSON(b []byte) error {
if string(b) == "null" {
return errors.New("chamber cannot be null")
}

return nil
}

// TraverseAndBuild will traverse all Chambers while inheriting their parent Toggles and executes a callback on each Chamber node.
// Traversing will stop if callback returns true.
// func (c *Chamber) TraverseAndBuild(callback func(Chamber) bool, children []*Chamber) {
Expand Down

0 comments on commit 1603c19

Please sign in to comment.