Re: [go-nuts] schedule a job executing in future

2020-10-20 Thread Zhihong GUO
Hello Uday and Jesper, Thank you so much for the answer. I found another solution and will have a try, https://github.com/gocraft/work, this library use Redis to save the future tasks. Best Regards, James Uday Kiran Jonnala 于2020年10月20日周二 上午9:29写道: > For the same scenario, we use the

Re: [go-nuts] gccgo problem compiling go from source

2020-10-20 Thread fgergo
On 10/20/20, gerritbinnenmars wrote: > Hello Ian,Thanks for the quick reaction. It seems my request was not > clear.What I am doing is the other way around: using gccgo to build the "go" > cmd.So clone the "go" source from github and then go build -compiler gccgo > ./cmd/goGerrit Assuming you

Re: [go-nuts] Table driven tests and error/output testing

2020-10-20 Thread Amit Saha
> On 20 Oct 2020, at 4:13 pm, Tamás Gulácsi wrote: > > Use bytes.Buffer or strings.Builder directly - no need for the bufio.Writer. > bufio.Writer only speeds up writing by calling the underlying Writer less, > with bigger slices. > Here you Write into a memory, just as bufio.Writer. > >

Re: [go-nuts] gccgo problem compiling go from source

2020-10-20 Thread Hugo Cornelis
Hi Gerrit, If I understand correctly, I believe you try to cross-compile Go applications to the PowerPC e500 architecture and as a first step you are porting Go to this architecture. We recently ported Go applications such as Docker and its tools to architectures not supported by upstream Go,

Re: [go-nuts] net/http TLS issue

2020-10-20 Thread Brian Candler
What key do you use to encrypt and decrypt the password in the config file? Something hard-coded in the application? That'll be easy to extract, e.g. by single-stepping the binary. It's also worth mentioning: with many filesystems, when you overwrite a file, garbage blocks containing the old

Re: [go-nuts] gccgo problem compiling go from source

2020-10-20 Thread David Riley
On Oct 20, 2020, at 2:38 AM, fge...@gmail.com wrote: > > After looking at the list of supported platforms on build.golang.org > and looking at the golang-nuts and golang-dev mailing list archives, I > can't see the ppc e500 as a supported hardware platform for the go > compiler (available on

[go-nuts] Golang slow performance inside for loop MySQL Queries

2020-10-20 Thread billyp314
I use Go with github.com/go-sql-driver/mysql to connect to MySQL. The performance in Go vs other languages is terrible or I'm missing something. I use Go for my REST API, an example is below: We have a table with posts. We fetch the posts, on each post we search favorites table (if user has

Re: [go-nuts] gccgo problem compiling go from source

2020-10-20 Thread Ian Lance Taylor
On Tue, Oct 20, 2020 at 8:17 AM Gerrit Binnenmars wrote: > > You are correct, what I try is to cross-compile a go application (in this > case Mender client) for the ppc platform (e500 on a MFC8555 processor). > 1. I used crosstool-ng instead of buildroot. It has support for "go" as >

[go-nuts] Re: Generating code into module cache?

2020-10-20 Thread seank...@gmail.com
That doesn't really make sense? The module cache is for immutable versions of modules, ie. publish your (generated) code as a package/module, import that it will then get cached On Tuesday, October 20, 2020 at 8:50:25 PM UTC+2 mattm...@gmail.com wrote: > Hey folks, > > I'm working on a project

Re: [go-nuts] Table driven tests and error/output testing

2020-10-20 Thread seank...@gmail.com
you should be able to unconditionally compare the output without doing the length check On Tuesday, October 20, 2020 at 8:51:56 AM UTC+2 amits...@gmail.com wrote: > > On 20 Oct 2020, at 4:13 pm, Tamás Gulácsi wrote: > > Use bytes.Buffer or strings.Builder directly - no need for the >

Re: [go-nuts] gccgo problem compiling go from source

2020-10-20 Thread Gerrit Binnenmars
I referred to this link on the internet: https://github.com/golang/go/wiki/GccgoCrossCompilation#build-a-cross-gccgo-aware-version-of-the-go-tool On Tuesday, October 20, 2020 at 5:18:05 PM UTC+2 Gerrit Binnenmars wrote: > Hello Hugo, > > You are correct, what I try is to cross-compile a go

[go-nuts] Generating code into module cache?

2020-10-20 Thread Matt Mueller
Hey folks, I'm working on a project with a lot of code generation. I'd love to: - get the code generation out of the way when you don't care about it - be able to vendor the generated code when you do care about it That led me to an idea about generating code into the go module cache. Do you

Re: [go-nuts] Golang slow performance inside for loop MySQL Queries

2020-10-20 Thread Marcin Romaszewicz
Go's database layer is generally pretty quick, I use it a lot, but your code immediately sets off my DB alarms, because you are doing queries within the body of another query loop, which means you're opening up lots of connections, which could be slow. I'd reorganize as followd. - Cache the

Re: [go-nuts] gccgo problem compiling go from source

2020-10-20 Thread Gerrit Binnenmars
Hello Hugo, You are correct, what I try is to cross-compile a go application (in this case Mender client) for the ppc platform (e500 on a MFC8555 processor). 1. I used crosstool-ng instead of buildroot. It has support for "go" as experimental language and as result a gccgo compiler is build and

[go-nuts] Any embedded scripting language for Go

2020-10-20 Thread Aravindhan K
Hi, I am looking for a way to build interactive app,where user will be giving instructions to draw as a script,rendering of the script will be displayed live. I would like to use below 2d drawing package for same, github.com/fogleman/gg Is there scripting language that would be able generate

Re: [go-nuts] Re: Generating code into module cache?

2020-10-20 Thread 'Axel Wagner' via golang-nuts
On a second read, I probably misunderstood what you intend to do. I still think what you intend to do might technically be possible - I'm not entirely sure, though. The module cache is by default read-only, so you'd want a tool that force-replaces a directory. And then, the go build cache might

Re: [go-nuts] Table driven tests and error/output testing

2020-10-20 Thread roger peppe
It looks like you're testing a top level command. You might want to consider using the testscript package, which provides a very concise way of end-to-end testing this kind of thing. e.g. mycommand -h cmp stdout expect-stdout -- expect-stdout -- Expected output See

Re: [go-nuts] Re: Generating code into module cache?

2020-10-20 Thread 'Axel Wagner' via golang-nuts
Technically, I think this would be possible. Your code wouldn't be usable together with code that doesn't use modules. And you'd need to have a server that takes the code from the git repository and generates a .zip file for any interesting version (possibly on demand), which you would probably

[go-nuts] Re: Generating code into module cache?

2020-10-20 Thread Matt Mueller
Sorry, maybe cache is the wrong word. Wherever "go get -u ..." downloads modules, I'd like to stick my generated code. Conceptually you could think of it as a virtual module used only during development. If you're familiar with Node.js, You could also think of it as creating a directory in