Standard library / slices
slices.AppendSeq()
Appends sequence elements to a slice; may reuse capacity. Retain the returned slice. Expected stdout: '[1 2 3]\n'.
Formal Syntax & Structure
go syntaxgo
func AppendSeq[Slice ~[]E, E any](s Slice, seq iter.Seq[E]) SliceParameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | Slice | Input slice; may share its backing array. |
| seq | iter.Seq[E] | Iterator function producing the input sequence. |
Return Value
Slice
Appends sequence elements to a slice; may reuse capacity. Retain the returned slice.
Working Example
Example Snippetgo
package main
import ( "fmt" "slices")
func main() { fmt.Println(slices.AppendSeq([]int{1}, slices.Values([]int{2, 3})))}