fix lint issues after update

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-10-19 12:31:24 +02:00
parent 6e5aefbb98
commit 503d483731
11 changed files with 28 additions and 51 deletions

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -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)