Some ways to do it:
https://play.golang.org/p/sg08Buv-E3-
Note that arrays are rarely used in Go. When in doubt, default to using a
slice. I provided slice examples as well.
If you want to initialize a very large array or slice to a value other than
the zero value, you could also use a loop.
https://play.golang.org/p/YtxPYZ4H-Sy
In practice, you'll usually find you want to create a slice, not an array.
Arrays have a fixed size.
On Wednesday, 14 July 2021 at 16:32:13 UTC+1 trivedi...@gmail.com wrote:
> Hi all, it would be helpful for me if a small doubt of mine is resolved.
>
> I w