Fix to lint

This commit is contained in:
Alexander Kiryukhin 2019-12-08 13:47:02 +03:00
parent c8749e6f6b
commit 8269e42b6b
2 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,7 @@
# Workflow for Go # Workflow for Go
[![GoDoc](https://godoc.org/github.com/neonxp/workflow?status.svg)](https://godoc.org/github.com/neonxp/workflow)
Simple state machine. Inspired by [Symfony Workflow](https://github.com/symfony/workflow). Simple state machine. Inspired by [Symfony Workflow](https://github.com/symfony/workflow).
## Example usage ## Example usage

View file

@ -7,7 +7,9 @@ import (
) )
var ( var (
ErrCantApply = errors.New("cant apply transition") // ErrCantApply error if transition is not applicable to object
ErrCantApply = errors.New("cant apply transition")
// ErrTransitionNotFound error if no transition with this name
ErrTransitionNotFound = errors.New("transition not found") ErrTransitionNotFound = errors.New("transition not found")
) )
@ -46,7 +48,7 @@ func (w *Workflow) GetEnabledTransitions(obj Placeer) []string {
if currentPlace == "" { if currentPlace == "" {
currentPlace = w.initialPlace currentPlace = w.initialPlace
} }
result := make([]string, 0) var result = make([]string, 0)
for name, t := range w.transitions { for name, t := range w.transitions {
for _, f := range t.From { for _, f := range t.From {
if f == currentPlace { if f == currentPlace {