I want to convert a fixed-size array from a slice:
func gen(bricks []Brick) { if len(bricks) == 16 { if check(Sculpture{bricks}) { var b [16]Brick = bricks[0:16]; } } }
But this leads to:
cannot use bricks[0:16] (type []Brick) as type [16]Brick in assignment
How to convert a slice to a fixed-size array?
arrays slice go
thi gg
source share