chore: minor
This commit is contained in:
parent
d0cfbe43c7
commit
ca8aae2dc5
1 changed files with 3 additions and 4 deletions
|
|
@ -11,7 +11,6 @@ import (
|
|||
|
||||
"github.com/evcc-io/evcc/api"
|
||||
"github.com/evcc-io/evcc/util"
|
||||
"github.com/samber/lo"
|
||||
"github.com/spf13/cast"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
|
@ -72,10 +71,10 @@ func (v *Provider) findOrCreateContainer() (string, error) {
|
|||
return "", err
|
||||
}
|
||||
|
||||
if cc := lo.Filter(containers, func(c Container, _ int) bool {
|
||||
if i := slices.IndexFunc(containers, func(c Container) bool {
|
||||
return c.Name == "evcc.io" && c.Purpose == requiredVersion
|
||||
}); len(cc) > 0 {
|
||||
return cc[0].ContainerId, nil
|
||||
}); i >= 0 {
|
||||
return containers[i].ContainerId, nil
|
||||
}
|
||||
|
||||
res, err := v.api.CreateContainer(CreateContainer{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue