This commit is contained in:
aozhiwei 2023-12-05 15:30:18 +08:00
parent 50cb269954
commit 3d4c6f692f

View File

@ -199,7 +199,7 @@ func NewSlice[T any](s *[]T, len int32, cap int32) {
func NewSliceElement[T any](s *[]T) *T { func NewSliceElement[T any](s *[]T) *T {
v := new(T) v := new(T)
*s = append(*s, *v) *s = append(*s, *v)
return v return &(*s)[len(*s) - 1]
} }
func AppendSlice[T any](s *[]T, val T) { func AppendSlice[T any](s *[]T, val T) {