aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-12-08 13:47:02 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2019-12-08 13:47:02 +0300
commit8269e42b6b4cf794b75d85d0f38a570813338cab (patch)
tree30f8e24b647a2f2dd9b3f4b253c98bb3cdbcd9eb
parentc8749e6f6bf8f39a94791526b39fadc11360476c (diff)
Fix to lint
-rw-r--r--README.md2
-rw-r--r--workflow.go6
2 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index df1e04f..efde801 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# 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).
## Example usage
diff --git a/workflow.go b/workflow.go
index 8911cec..203401d 100644
--- a/workflow.go
+++ b/workflow.go
@@ -7,7 +7,9 @@ import (
)
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")
)
@@ -46,7 +48,7 @@ func (w *Workflow) GetEnabledTransitions(obj Placeer) []string {
if currentPlace == "" {
currentPlace = w.initialPlace
}
- result := make([]string, 0)
+ var result = make([]string, 0)
for name, t := range w.transitions {
for _, f := range t.From {
if f == currentPlace {