[go-nuts] How to append all new messages in a slice?

2020-01-14 Thread nks
Hello Gophers, I created a TCP server that gets all the requests from the client and replies, however, when I try to append those requests in a slice, *the next request erases the previous one.* *The server should get requests and continuously save them in a slice for future manipulation.*

[go-nuts] How to get the index of a slice of type string

2020-01-06 Thread nks
How to get the index of a slice of type string like in this example, I want to test if the index equals to 3 in slice b and print ok. a:=[int]string("hi","holla","salut") b=append(a) b =append(b,"c") for _, count:= range b{ if b[]=3 { fmt.Println("ok") }; Enter code here... -- You

[go-nuts] Re: How to fill a map with requests from client

2020-01-03 Thread nks
e a request arrives. > So a new empty map gets created each time a request arrives. > > The comment on the second line is wrong. The code does not "append" to the > map. It overwrites the "client request" element. > > > On Friday, 3 January 2020 07:14: