Go 1.10 with build and test caching, running Windows and Linux Docker containers side-by-side with LCOW.
It’s been 6 months again since 1.9 was released, so as scheduled we’ve now got Go 1.10. The big headlining feature of this release is probably the build and test caching. While similar in name, these two do slightly different things so let’s have a quick look at them.
Build caching means that
go build has a cache of recently built packages, and checks when you run
go build if these packages have been updated or if it can pull them from its cache. This even applies to packages that aren’t installed locally, and because of that
go install will no longer install dependencies for the packages you install.
Personally though, I’m more interested in the test caching. What this does is that it checks code changes between runs of
go test and only runs tests that may have been impacted. Everything else, provided it passed originally, will get the same result shown and a mark of (cached) instead of the time it took to run.
The result of this is that if you have a big project, running all the tests shouldn’t have a performance penalty anymore1 as only what you changed will be run. As a side effect, I suspect this means you can clearly see what parts of the code are affected by your changes.
Of course, these are far from the only changes and a comprehensive list of everything new and improved can be found in the release notes.
Docker for Windows LCOW
A couple weeks ago I mentioned that Docker for Windows2 has support for Kubernetes, but it turns out there is another big feature coming. While still marked as experimental Docker will be able to run Linux containers through LCOW3.
Up until now, you had to choose one of 3 modes for your containers on Windows: Windows, Linux, or LCOW. As you can expect from the name, LCOW was already aimed at running Linux which means there were two options for that. The big difference between the two is that Linux mode uses a VM while LCOW uses LinuxKit similar to how it works on the Mac.
What has changed now is that LCOW is built into the Windows mode. This means that you can run your containers in a single mode, regardless of whether they’re Windows or Linux4. This is a big usability win for Windows containers and the people using them. Right now the VM Linux mode will still be available due to the experimental nature of LCOW, but as soon as that’s deemed stable the Linux mode will disappear and there will just be a single way of running your containers on Windows.
Related content you might like:
- Week 44, 2018 - AWS Minor Feature Love for Databases; Containers; and Lambda
- Week 23, 2018 - Amazon Neptune; ALB Built-in Authentication; Helm in CNCF
- Week 19, 2018 - Operator Framework; gVisor; Stack Overflow for Teams; AWS CodeBuild Local Build
- Week 14, 2018 - Jenkins X; Windows Server 2019; Azure Serial Console; Cloudflare Workers
- Week 10, 2018 - Memcrashed; Learn with Google AI; vgo