Skip to content

Commit

Permalink
feat(exp): rename AppendNextActions to AppendNext (#452)
Browse files Browse the repository at this point in the history
Use a smaller name, as we already refer to actions in the package name: 
- `actionutils.AppendNextActions ` => `actionutils.AppendNext`
  • Loading branch information
jooola authored Jun 4, 2024
1 parent 9c1966b commit 9b6239a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hcloud/exp/actionutils/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package actionutils

import "github.com/hetznercloud/hcloud-go/v2/hcloud"

// AppendNextActions return the action and the next actions in a new slice.
func AppendNextActions(action *hcloud.Action, nextActions []*hcloud.Action) []*hcloud.Action {
// AppendNext return the action and the next actions in a new slice.
func AppendNext(action *hcloud.Action, nextActions []*hcloud.Action) []*hcloud.Action {
all := make([]*hcloud.Action, 0, 1+len(nextActions))
all = append(all, action)
all = append(all, nextActions...)
Expand Down
4 changes: 2 additions & 2 deletions hcloud/exp/actionutils/actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"github.com/hetznercloud/hcloud-go/v2/hcloud"
)

func TestAppendNextActions(t *testing.T) {
func TestAppendNext(t *testing.T) {
action := &hcloud.Action{ID: 1}
nextActions := []*hcloud.Action{{ID: 2}, {ID: 3}}

actions := AppendNextActions(action, nextActions)
actions := AppendNext(action, nextActions)

assert.Equal(t, []*hcloud.Action{{ID: 1}, {ID: 2}, {ID: 3}}, actions)
}

0 comments on commit 9b6239a

Please sign in to comment.