mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-30 23:28:04 +08:00
lint: apply x/tools/modernize fixes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package store
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/platforms"
|
||||
@@ -44,7 +45,7 @@ func (ng *NodeGroup) Leave(name string) error {
|
||||
if len(ng.Nodes) == 1 {
|
||||
return errors.Errorf("can not leave last node, do you want to rm instance instead?")
|
||||
}
|
||||
ng.Nodes = append(ng.Nodes[:i], ng.Nodes[i+1:]...)
|
||||
ng.Nodes = slices.Delete(ng.Nodes, i, i+1)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -39,7 +39,7 @@ func ValidateName(s string) (string, error) {
|
||||
|
||||
func GenerateName(txn *Txn) (string, error) {
|
||||
var name string
|
||||
for i := 0; i < 6; i++ {
|
||||
for i := range 6 {
|
||||
name = namesgenerator.GetRandomName(i)
|
||||
if _, err := txn.NodeGroupByName(name); err != nil {
|
||||
if !os.IsNotExist(errors.Cause(err)) {
|
||||
|
Reference in New Issue
Block a user