← Back to archive

Stdle #27 · slices · 2026-07-03

What does this Go snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

package main
import "fmt"
func main() {
dst := make([]byte, 3)
n := copy(dst, "hello")
fmt.Println(n, string(dst))
}
Slices
4 attempts left

Answer & explanation