If you are coming from Java or .net background, you must be familiar with the fact that collection framework are the backbone and handy for us.
You must be wondering that there is no collection framework in Go Lang and wondering how to do the same process which you have been doing in other language.
Resizable arrays are there for rescue.
package main
import "fmt"
func main()
myArr:=[]string
myArr=append(myArr,"Rajesh")
myArr=append(myArr,"Iswarya","Nishesha","Vishwesh")
fmt.Println(myArr)
Initially we declare an empty array of String
Then we append the values as we need and there we go
Official Documentation says as below
Comments
Post a Comment