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

2020-10-19 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. > > Also

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

2020-10-19 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 are

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

2020-10-19 Thread Tamás Gulácsi
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. Also, you can save some allocations by creating the buffer once outside o

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

2020-10-19 Thread gerritbinnenmars
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 Oorspronkelijk bericht Van: Ian Lance Taylor

Re: [go-nuts] Positional arguments and flag package

2020-10-19 Thread Amit Saha
On Thu, Oct 15, 2020 at 4:27 PM Roland Müller wrote: > > Actually, it's explicitly documented, so I don't have to guess: > https://golang.org/pkg/flag/#hdr-Command_line_flag_syntax Thank you. I read it and it makes sense why the behavior is like that. > > > Am Do., 15. Okt. 2020 um 08:22 Uhr sch

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

2020-10-19 Thread Amit Saha
Hi all, Consider the following test configuration: func TestHandleCommand(t *testing.T) { type expectedResult struct { output string errerror } type testConfig struct { args []string result expectedResult } testConfigs := []testConfig{

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

2020-10-19 Thread Ian Lance Taylor
On Mon, Oct 19, 2020 at 2:06 PM Gerrit Binnenmars wrote: > > I used crosstool-ng successfully to build a go compiler for ppc e500. > Unfortunately go build does not support ppc therefore go needs to be > build from source using the amd64 gccgo compiler that I also build > with crosstool-ng. > > Co

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

2020-10-19 Thread Uday Kiran Jonnala
For the same scenario, we use the following - Go cron to schedule the job execution - For crash consistency of the program, use a DB (as mentioned by Jasper also) with a db entry for job schedule information. On Monday, October 19, 2020 at 2:33:50 AM UTC-7 jesper.lou...@gmail.com wrote: > On M

[go-nuts] gccgo problem compiling go from source

2020-10-19 Thread Gerrit Binnenmars
Hello, I used crosstool-ng successfully to build a go compiler for ppc e500. Unfortunately go build does not support ppc therefore go needs to be build from source using the amd64 gccgo compiler that I also build with crosstool-ng. Compiling go from source fails: Problem: undefined name stdpkg in

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

2020-10-19 Thread Rich
Thanks for your reply. I think I have it down now. What I am going to do is: 1. Read the key in to pemBlk 2. See if it's got a passcode 3. If it does decrypt ``` if x509.IsEncryptedPEMBlock(pemBlk) { keyPEMBlock, err = x509.DecryptPEMBlock(pemBlk, []byte(passphrase)) ``` As to having to have

Re: [go-nuts] Re: implementing macro in plan 9 assembly

2020-10-19 Thread Diego Joss
Have a look at https://golang.org/doc/asm and examples are always a good source of inspiration. For example https://golang.org/src/math/dim.go at line 35 defines the prototype for function Max, which is implemented in assembly in https://golang.org/src/math/dim_amd64.s -- Diego On Fri, 16 Oct 202

[go-nuts] Openings for Golang backend engineers at Kawa Space

2020-10-19 Thread Kalpana SR
*At Kawa Space, we’re a super crazy bunch, building the future of how space-based solutions are provisioned and consumed at scale; We are a small bunch of geeks who are interested in writing code, passionate about building systems, curious in analyzing images from space and dedicated to

[go-nuts] protoc-gen-go uses deprecated libraries

2020-10-19 Thread bsr
Hello, I am coming back to a project after few months, and there has been changes to the protobuf libraries. I read the blog post, and docs followed the instructions to install and use the library. Please see the bel

[go-nuts] Re: I need help writing an article about the Go implementation of hash tables

2020-10-19 Thread Marwan abdel moneim
Thanks very much, I didn't know about that talk before. Will watch it and dive into the code, and see how far I can I understand it. On Monday, October 19, 2020 at 3:32:38 AM UTC+2 peterGo wrote: > GopherCon 2016: Keith Randall - Inside the Map Implementation > https://www.youtube.com/watch?v=Tl7

Re: [go-nuts] Option -Wl,--whole-archive seems not work

2020-10-19 Thread thierry thierry
Thanks. It works perfectly ! > On 18 Oct 2020, at 00:55, Ian Lance Taylor wrote: > > On Sat, Oct 17, 2020 at 12:25 PM Thierry Fournier > wrote: >> >> I need to build go with an archive file which requires to be linked with the >> option "-Wl,--whole-archive" on linux or "-Wl,-all_load" on ma

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

2020-10-19 Thread Jesper Louis Andersen
On Mon, Oct 19, 2020 at 9:51 AM Zhihong GUO wrote: > > I am implementing a reminder system. The purpose is to provide API to > client App to add a meeting, and before X minutes the meeting is to open, > the reminder system can send notif to user by SMS or email. Here I need a > function like: whe

[go-nuts] schedule a job executing in future

2020-10-19 Thread Zhihong GUO
Hello all, I am implementing a reminder system. The purpose is to provide API to client App to add a meeting, and before X minutes the meeting is to open, the reminder system can send notif to user by SMS or email. Here I need a function like: when a meeting is created, check the open time of the