The lightning talks are the first round of lightning talks from many speakers.
Note: This post was live-blogged at dotGo 2017. Let us know on Twitter (@srcgraph) if we missed anything. All content is from the talk; any mistakes or misrepresentations are our fault, not the speaker's.
Reducing Go programs
Reducing go program means to simplify code without changing what it does.
Some issues in Go toolchain is that Daniel had to write out the bytes and
invoke the full compiler toolchain to see if the bug still reproduced. This
means 100ms to make change, which is slow to automatically reduce.
See mvdan.cc/goreduce to find out more and try out the tool.
Handling slow requests in your Go web server
A common problem in HTTP servers is doing slow jobs. For example processing
that takes minutes.
To do this naively your users will run into issues like 504 gateway
Usually what people do is introduce a Job Queue.
Problem is this is a new bit of infrastructure to manage.
Another problem is serialization and deserialization can be significant for
large upload payloads.
Solution 1 is queue with channels + worker pattern.
Identify jobs with ticket number, track progress in DB
goroutine listening, running and publishing results
Problems when you can get too much work to do
Solutions: time limit, channel buffered, more worker goroutines
Solution 2 Just start goroutine
Shutdown is a problem due to potentially losing work, can use waitgroup.
Solution is simple and works well.
Conclusion: You can handle slow requests entirely in your go server.
You are coding a lot and run go get a lot to get great packages to solve
You are about to launch your product but then have to do legal review.
The lawyers start vetting dependency packages with bad license.
The issue here is license creep, you introduce a dependency without
realising you can't use it due to the license.
Fabio created a tool called: WWHRD - What would Henry Rollins Do. \m/