Skip to content
Discussion options

You must be logged in to vote

If i understood correctly you want to concatenate two slices?

Go has a function for this:

import "go:slices"

fn main() {
  let a = [1, 2, 3]
  let b = [4, 5, 6]

  let merged = slices.Concat(a, b)

  for item in merged {
    // do stuff
  }
}

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Brixy
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants