Skip to content

Commit

Permalink
Merge pull request #10 from tiramiseb/code-structure
Browse files Browse the repository at this point in the history
Code structure
  • Loading branch information
tiramiseb committed Jun 22, 2022
2 parents 3c8931a + 5ccab94 commit 9af8aa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions instructions/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ type Group struct {
next *Group
}

// Check runs the group checks and returns its success status
func (g *Group) Check(signalTarget chan bool, reset bool) bool {
// TODO Is the return value really used?
vars := NewVariablesSet()
// Check runs the group checks
func (g *Group) Check(signalTarget chan bool, reset bool) {
vars := newVariablesSet()
g.Reports = g.Reports[:0]
if signalTarget != nil {
signalTarget <- true
Expand All @@ -38,10 +37,9 @@ func (g *Group) Check(signalTarget chan bool, reset bool) bool {
r, ok := ins.RunCheck(vars, signalTarget)
g.Reports = append(g.Reports, r...)
if !ok {
return false
return
}
}
return true
}

// Status returns status of the group (according to statuses of its instructions)
Expand Down
2 changes: 1 addition & 1 deletion instructions/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewGlobalVar(key, value string) {
globalVars.define(key, value)
}

func NewVariablesSet() Variables {
func newVariablesSet() Variables {
return globalVars.clone()
}

Expand Down

0 comments on commit 9af8aa2

Please sign in to comment.