Daily Archives: 22.04.2019

How go code is being compiled to assembler code

https://go.godbolt.org/z/31FyJ3 I was interested in comparing line 15 vs line 17 of the following code: package main import «fmt» type kv struct { key []byte value []byte } type sliceMap []kv func (sm *sliceMap) Add(k, v []byte) { kvs := *sm if cap(kvs) > len(kvs) { kvs = kvs[:len(kvs)+1] } else { kvs = append(kvs, …

Read more

E2E tests in go

I tried it via ginkgo and gomega. It has Agouti with WebDriver support out of the box, but I didn’t use it as we have grpc API. That’s the example (table tests): var _ = Describe(«GetRoute», func() { var ( srClient sr.Client srErr error ) JustBeforeEach(func() { srClient, srErr = GetClient() }) DescribeTable(«positive cases», func(fromGeoPointID, …

Read more

What is teamlead’s first duty

Sarah Mei «We think awful code is written by awful devs. But in reality, it’s written by reasonable devs in awful circumstances.» (source) So, teamlead is there to improve circumstances.