fix lint errors
Some checks failed
Lint / golangci-lint (push) Failing after 9m53s
Machine Tests / test (push) Successful in 40s

This commit is contained in:
Matthew Rich 2024-04-04 13:08:50 -07:00
parent 8b92e9e143
commit 85e39191b8
10 changed files with 180 additions and 181 deletions

View File

@ -38,7 +38,7 @@ func (d *Definition) AddTransition(trigger string, source State, dest State) {
func (d *Definition) GetState(name string) State {
var r State
for _,s := range(d.states) {
for _, s := range d.states {
if string(s) == name {
return s
}

View File

@ -3,9 +3,9 @@
package machine
import (
"github.com/stretchr/testify/assert"
"log"
"testing"
"github.com/stretchr/testify/assert"
)
func setupStater(initial State) Stater {

View File

@ -9,4 +9,3 @@ type mState struct {
func NewState(name string) *mState {
return &mState{name: name}
}

View File

@ -3,8 +3,8 @@
package machine
import (
_ "errors"
"fmt"
"errors"
)
type Transitioner interface {
@ -33,7 +33,7 @@ func (r *Transition) Run(m Modeler) error {
return nil
}
}
return errors.New(fmt.Sprintf("Transition from %s to %s failed on model state %s", r.source, r.dest, currentState))
return fmt.Errorf("Transition from %s to %s failed on model state %s", r.source, r.dest, currentState)
}
func (r *Transition) Subscribe(s Subscriber) {

View File

@ -3,9 +3,9 @@
package machine
import (
"github.com/stretchr/testify/assert"
"log"
"testing"
"github.com/stretchr/testify/assert"
)
func setupTransition() Transitioner {