fix lint errors
Some checks failed
Lint / golangci-lint (push) Failing after 9m49s
Declarative Tests / test (push) Successful in 1m19s

This commit is contained in:
Matthew Rich 2024-05-14 12:53:42 -07:00
parent 6df89a7a38
commit 3a33bed423
2 changed files with 6 additions and 5 deletions

View File

@ -97,11 +97,12 @@ func (u *User) Notify(m *machine.EventMessage) {
case machine.ENTERSTATEEVENT: case machine.ENTERSTATEEVENT:
switch m.Dest { switch m.Dest {
case "start_create": case "start_create":
if e := u.Create(ctx); e != nil { if e := u.Create(ctx); e == nil {
if triggerErr := u.stater.Trigger("created"); triggerErr != nil { if triggerErr := u.stater.Trigger("created"); triggerErr == nil {
// transition error return
} }
} }
u.State = "absent"
case "present": case "present":
u.State = "present" u.State = "present"
} }

View File

@ -46,7 +46,7 @@ func NewFileDocTarget(u *url.URL, format string, gzip bool, fileUri bool) DocTar
t.Path = filepath.Join(u.Hostname(), u.Path) t.Path = filepath.Join(u.Hostname(), u.Path)
} }
if e := t.Open(); e != nil { if e := t.Open(); e != nil {
// open target return nil
} }
return t return t
} }
@ -71,7 +71,7 @@ func init() {
} }
} }
if e := t.Open(); e != nil { if e := t.Open(); e != nil {
// open target return nil
} }
return t return t
}) })