Re: [go-nuts] how to add items to an array without append function.

2018-01-12 Thread pradam
Hi Marvin, Awesome explanation. I have learnt alot things through your mail.once again you made my day. Thank you On 12-Jan-2018 9:31 PM, "Marvin Renich" wrote: > * pradam [180112 01:45]: > > I'm Newbie to golang, > > Welcome to Go! Many newbies often use "golang" rather than "Go" as the > l

Re: [go-nuts] how to add items to an array without append function.

2018-01-12 Thread Marvin Renich
* pradam [180112 01:45]: > I'm Newbie to golang, Welcome to Go! Many newbies often use "golang" rather than "Go" as the language name, and most old-timers usually ignore this incorrect usage, but golang is an artifact of the web site's hostname, golang.org. Also, using golang in web searches fo

Re: [go-nuts] how to add items to an array without append function.

2018-01-12 Thread Shawn Milochik
On Fri, Jan 12, 2018 at 2:11 AM, pradam wrote: > Hi Shawn, > > Thank you, it was very helpful. I am not complaining about the language > just exploring the how golang works. > > Awesome! You're welcome. Sorry I misinterpreted your wording. -- You received this message because you are subscribed

Re: [go-nuts] how to add items to an array without append function.

2018-01-11 Thread pradam
Hi Shawn, Thank you, it was very helpful. I am not complaining about the language just exploring the how golang works. On Fri, Jan 12, 2018 at 12:31 PM, Shawn Milochik wrote: > What problem are you trying to solve? There's no reason to avoid append -- > it's the way the language provides to add

Re: [go-nuts] how to add items to an array without append function.

2018-01-11 Thread Shawn Milochik
What problem are you trying to solve? There's no reason to avoid append -- it's the way the language provides to add items to an existing slice. You can create a slice with a length higher than zero and then put things in at specific indices: x := make([]int, 10) x[9] = 4 fmt.Println(x) m = {1,

[go-nuts] how to add items to an array without append function.

2018-01-11 Thread pradam
Hi Gophers, I'm Newbie to golang, var m []int //array declaration m = {1,2,3,4,5,6,7} // this throws error so I have declared an array which takes only int items, so I can append items to it with append function.: m = append(m, 1,2,3,4,5,6,7,8,9) but I want to insert items without using ap