Skip to content

Commit add77c6

Browse files
committed
add slice.New util function
1 parent 4848481 commit add77c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

coderd/util/slice/slice.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,8 @@ func OverlapCompare[T any](a []T, b []T, equal func(a, b T) bool) bool {
6262
}
6363
return false
6464
}
65+
66+
// New is a convenience method for creating []T.
67+
func New[T any](items ...T) []T {
68+
return items
69+
}

0 commit comments

Comments
 (0)