From 553f63e76be876bda6d25c620788c7b7d75a0dc3 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Wed, 27 Jul 2022 15:45:34 +0800 Subject: [PATCH] refactor: update param name in AppendIfAbsent --- slice/slice.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slice/slice.go b/slice/slice.go index eafb17b..3ec1b52 100644 --- a/slice/slice.go +++ b/slice/slice.go @@ -853,9 +853,9 @@ func ToSlice[T any](value ...T) []T { } // AppendIfAbsent only absent append the value -func AppendIfAbsent[T comparable](slices []T, value T) []T { - if !Contain(slices, value) { - slices = append(slices, value) +func AppendIfAbsent[T comparable](slice []T, value T) []T { + if !Contain(slice, value) { + slice = append(slice, value) } - return slices + return slice }