mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-08-07 19:18:02 +08:00
fix lint issues after update
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -102,10 +102,7 @@ func (ng *NodeGroup) Update(name, endpoint string, platforms []string, endpoints
|
||||
}
|
||||
|
||||
ng.Nodes[i] = n
|
||||
if err := ng.validateDuplicates(endpoint, i); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return ng.validateDuplicates(endpoint, i)
|
||||
}
|
||||
|
||||
if name == "" {
|
||||
@@ -127,11 +124,7 @@ func (ng *NodeGroup) Update(name, endpoint string, platforms []string, endpoints
|
||||
}
|
||||
|
||||
ng.Nodes = append(ng.Nodes, n)
|
||||
|
||||
if err := ng.validateDuplicates(endpoint, len(ng.Nodes)-1); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return ng.validateDuplicates(endpoint, len(ng.Nodes)-1)
|
||||
}
|
||||
|
||||
func (ng *NodeGroup) Copy() *NodeGroup {
|
||||
|
@@ -185,10 +185,7 @@ func (t *Txn) reset(key string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := ioutils.AtomicWriteFile(filepath.Join(t.s.root, "current"), dt, 0600); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return ioutils.AtomicWriteFile(filepath.Join(t.s.root, "current"), dt, 0600)
|
||||
}
|
||||
|
||||
func (t *Txn) Current(key string) (*NodeGroup, error) {
|
||||
|
@@ -18,9 +18,9 @@ func TestEmptyStartup(t *testing.T) {
|
||||
s, err := New(tmpdir)
|
||||
require.NoError(t, err)
|
||||
|
||||
txn, close, err := s.Txn()
|
||||
txn, release, err := s.Txn()
|
||||
require.NoError(t, err)
|
||||
defer close()
|
||||
defer release()
|
||||
|
||||
ng, err := txn.Current("foo")
|
||||
require.NoError(t, err)
|
||||
|
Reference in New Issue
Block a user