[go-nuts] How to make a server being server and client simultaneously

2020-01-14 Thread GopherNewbie
Hello Gophers, I programmed a server (A) that listens on 2 different ports, but I would like to change one of the ports to be sending the client's received requests to another server (B) so that when the server (B) replies the server (A) sends the answer to that specific client. I got some

[go-nuts] Re: What is idiomatic way to find if struct field is exported or not?

2020-01-14 Thread tmaclong0521
if !reflect.ValueOf(strct).Field(i).CanInterface() { continue } 在 2016年4月27日星期三 UTC+8上午3:10:34,Tad Vizbaras写道: > > While reviewing number of popular packages online I noticed different > approaches to the same problem: > how to find if struct field is exported or not? > > Some use PkgPath

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

2020-01-14 Thread Kurtis Rader
Line 55 creates a new slice1 object every time you execute the body of the loop. So it's always empty when you do the append(slice1, dataT). Try moving it to line 37. I didn't closely examine your code but it looks like there are other problems with it. For example, you don't use slice2 and the

[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.*

Re: [go-nuts] Getting from a string to an object value - how?

2020-01-14 Thread Ian Lance Taylor
On Tue, Jan 14, 2020 at 10:27 AM 'Vinay Sajip' via golang-nuts wrote: > > I have a string value that I’d like to convert into an actual object in my > running program. The string would be read from a configuration file. For > example, the string "os:Stdin" should be processable somehow to get

[go-nuts] Re: crypto data types

2020-01-14 Thread R Srinivasan
Indeed. My search yielded: go get -u -v github.com/ianmcmahon/encoding_ssh which had exactly what I needed (and should probably be included in the standard ssh package) The use case itself - a digital signature facility in our Over The Network software upgrade procedure. The following is a

[go-nuts] Getting from a string to an object value - how?

2020-01-14 Thread 'Vinay Sajip' via golang-nuts
I have a string value that I’d like to convert into an actual object in my running program. The string would be read from a configuration file. For example, the string "os:Stdin" should be processable somehow to get the actual variable os.Stdin. Is that possible in Go? The reflect package seems

[go-nuts] TLS connection cannot be used after timeout of "SetDealine"

2020-01-14 Thread petavy
Hi Gophers, I have client code which test network transfer performance per second. For that I use "conn.SetDeadline(time.Second)". The performance testing is performed in a loop ot 5 rounds where each round sets a "SetDeadline" and then d a io.Copy/ZeroReader to the server and count the

[go-nuts] Re: crypto data types

2020-01-14 Thread a2800276
> > > looking for guidance on how to get an rsa.PublicKey from id_rsa.pub > seems like I can parse the id_rsa.pub contents and get a ssh.PublicKey but > how do I transform this into an rsa.PublicKey > i need the coersion in order to use other support services. > > Please consider whether this is

Re: [go-nuts] Shell alias to get latest go versions?

2020-01-14 Thread Paul Jolly
I think you're after something like (for your OS/arch): wget https://dl.google.com/go/$(curl -s https://golang.org/dl/?mode=json | jq -r .[0].version).linux-amd64.tar.gz The JSON mode of the download page being the key here. On Tue, 14 Jan 2020 at 09:22, Steve Mynott wrote: > > Does anyone

[go-nuts] Shell alias to get latest go versions?

2020-01-14 Thread Steve Mynott
Does anyone have a simple shell alias, function or similar to get the latest released versions of go? Is there a cleaner way of going this than screen scraping the website or looking at tags in git? -- Steve Mynott cv25519/ECF8B611205B447E091246AF959E3D6197190DD5 -- You received this message