Re: [go-nuts] golang protobuf, struct copy problem

2020-05-20 Thread Steve Simon
i feel your pain. i have had exactly the same problem using protobufs over nats. i think it comes down to the competing demands of the data representations of different applications, and keeping a clean, minimal layout on the wire. i ended up with a disappointing amount of boilerplate code per R

Re: [go-nuts] golang protobuf, struct copy problem

2020-05-20 Thread Jesper Louis Andersen
As a general rule, be cautious when your external data representation is one-to-one with your internal data representation. There is a risk of tight coupling in this case. The wire format is not always how you want to handle data internally in the application. The lure is that you can build a syste

Re: [go-nuts] Any solution to hide my source code written in Go and make it a library to develop in Go as well

2020-05-20 Thread Wojciech S. Czarnecki
Dnia 2020-05-17, o godz. 23:13:28 Billy Cui napisał(a): > Looks this works, anyone know the plugin mode is easy crack out the source > code or not? Read IDA Pro manuals, take a look at IDAGolangHelper scripts for it, then do not waste your time on futile obfuscation. It will work only if your

Re: [go-nuts] Any solution to hide my source code written in Go and make it a library to develop in Go as well

2020-05-20 Thread Jake Montgomery
Not sure if you care, but plugins are (sadly) not yet supported in Windows. So if you go that route you will not work on Windows. On Sunday, May 17, 2020 at 11:21:40 PM UTC-4, robert engels wrote: > > Just distribute it as a plugin (https://golang.org/pkg/plugin/) - you > only need to make the

Re: [go-nuts] Any solution to hide my source code written in Go and make it a library to develop in Go as well

2020-05-20 Thread Billy Cui
Hi Ohir, Thanks for your explanation. I'll consider that. On Wednesday, May 20, 2020 at 9:48:48 PM UTC+8, ohir wrote: > > Dnia 2020-05-17, o godz. 23:13:28 > Billy Cui > napisał(a): > > > Looks this works, anyone know the plugin mode is easy crack out the > source code or not? > > Read IDA P

[go-nuts] Re: golang protobuf, struct copy problem

2020-05-20 Thread Saied Seghatoleslami
Why not use gob encoding? I am using it across nats and it is working fine. The only workaround that I have had to do is to string encode the errors and convert them back to errors on the other side. On Friday, May 8, 2020 at 2:56:22 PM UTC-4, cheng dong wrote: > > i use protobuf to do rpc in

[go-nuts] How to parseFile with ...string?

2020-05-20 Thread Vivi
I have not thought of a way how to have 2 or multiple files as a separate string to be parsed by API that request for ...string The end goal to verify HTML template for error through a function call, is there a better approach? func checkHTML(str string) { template.ParseFiles(strHTML) }

[go-nuts] Re: How to parseFile with ...string?

2020-05-20 Thread Saied Seghatoleslami
This is what Alex Edwards in his book "Let's Go" does and I am using it. He writes it to a buffer and checks for errors. Enter code here... Enter code here...func (app *App) render(w http.ResponseWriter, r *http. Request, name string) { t := app.cache[name] buf := new(bytes.Buffer) tData, err :

Re: [go-nuts] DNS lookup timeouts could return net.DNSError instead of poll.TimeoutError

2020-05-20 Thread therealmarkhale
Thanks Ian. I've raised #39178 . On Wednesday, 20 May 2020 00:49:57 UTC+1, Ian Lance Taylor wrote: > > On Tue, May 19, 2020 at 4:27 PM > > wrote: > > > > I get DNS lookup timeouts many times a day when running Go HTTP clients > on Kubernetes, where UD

[go-nuts] Maddy - composable all-in-one mail server

2020-05-20 Thread hexawolfie
Hello, I would like to introduce a project that, in my opinion, needs more attention as it has a great potential. It is a secure-by-default MTA and MDA implementation in a single server called Maddy, which works similarly to Caddy web server. >From what I witness, it is already working pretty w

[go-nuts] Is there a possible to add sync.Pool to io.copyBuffer

2020-05-20 Thread qingyunha
Hi all: I write a simpile HTTP proxy,and find the most alloctions appear in io.copyBuffer (pprof) list io.copyBuffer > > Total: 2.80TB > > ROUTINE io.copyBuffer in >> /usr/local/go/src/io/io.go > > 1.03TB 2.47TB (flat, cum) 88.16% of Total > > .

Re: [go-nuts] Is there a possible to add sync.Pool to io.copyBuffer

2020-05-20 Thread Ian Lance Taylor
On Wed, May 20, 2020 at 9:26 PM wrote: > > Hi all: > I write a simpile HTTP proxy,and find the most alloctions appear in > io.copyBuffer > >>> (pprof) list io.copyBuffer >>> >>> Total: 2.80TB >>> >>> ROUTINE io.copyBuffer in /usr/local/go/src/io/io.go >>> >>> 1.03TB