fix lint errors
This commit is contained in:
parent
8b92e9e143
commit
85e39191b8
@ -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
|
||||
}
|
||||
|
@ -3,9 +3,9 @@
|
||||
package machine
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"log"
|
||||
"testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func setupStater(initial State) Stater {
|
||||
|
1
state.go
1
state.go
@ -9,4 +9,3 @@ type mState struct {
|
||||
func NewState(name string) *mState {
|
||||
return &mState{name: name}
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -3,9 +3,9 @@
|
||||
package machine
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"log"
|
||||
"testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func setupTransition() Transitioner {
|
||||
|
Loading…
Reference in New Issue
Block a user