fix lint errors
This commit is contained in:
parent
4c1540685d
commit
6df89a7a38
@ -4,7 +4,7 @@ package resource
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
_ "fmt"
|
||||
"fmt"
|
||||
"gopkg.in/yaml.v3"
|
||||
"io"
|
||||
"log/slog"
|
||||
@ -122,9 +122,11 @@ func (d *Document) YAML() ([]byte, error) {
|
||||
return yaml.Marshal(d)
|
||||
}
|
||||
|
||||
func (d *Document) Diff(with *Document, output io.Writer) (string, error) {
|
||||
func (d *Document) Diff(with *Document, output io.Writer) (returnOutput string, diffErr error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
returnOutput = ""
|
||||
diffErr = fmt.Errorf("%s", r)
|
||||
}
|
||||
}()
|
||||
slog.Info("Document.Diff()")
|
||||
|
@ -64,22 +64,22 @@ func StorageMachine(sub machine.Subscriber) machine.Stater {
|
||||
stater.AddStates("absent", "start_create", "present", "start_delete", "start_read", "start_update")
|
||||
stater.AddTransition("create", "absent", "start_create")
|
||||
if e := stater.AddSubscription("create", sub); e != nil {
|
||||
|
||||
return nil
|
||||
}
|
||||
stater.AddTransition("created", "start_create", "present")
|
||||
stater.AddTransition("read", "*", "start_read")
|
||||
if e := stater.AddSubscription("read", sub); e != nil {
|
||||
|
||||
return nil
|
||||
}
|
||||
stater.AddTransition("state_read", "start_read", "present")
|
||||
stater.AddTransition("update", "*", "start_update")
|
||||
if e := stater.AddSubscription("update", sub); e != nil {
|
||||
|
||||
return nil
|
||||
}
|
||||
stater.AddTransition("updated", "start_update", "present")
|
||||
stater.AddTransition("delete", "*", "start_delete")
|
||||
if e := stater.AddSubscription("delete", sub); e != nil {
|
||||
|
||||
return nil
|
||||
}
|
||||
stater.AddTransition("deleted", "start_delete", "absent")
|
||||
return stater
|
||||
|
Loading…
Reference in New Issue
Block a user