Go Icon

Go

Go is a programming language built to resemble a simplified version of the C programming language.
293 Stories
All Topics

Go blog.golang.org

Go and the Go community during this pandemic

In this post Carmen Andoh, Russ Cox, and Steve Francia share important notes about how the pandemic is affecting the Go community, what they’re doing to help, what you can do to help, and upcoming plans for Go itself.

Go always comes second to more basic concerns like personal and family health and safety. Around the world, the past couple months have been terrible, and we are still at the start of this awful pandemic. There are days when it seems like working on anything related to Go should be considered a serious priority inversion.

But after we’ve done all we can to prepare ourselves and our families for whatever is coming, getting back to some approximation of a familiar routine and normal work is a helpful coping mechanism. In that spirit, we intend to keep working on Go and trying to help the Go community as much as we can.

Go github.com

GoTube – a very simple command line tool for downloading YouTube videos

This repository contains a single-file implementation of YouTube video downloader written in Go. It does not require any third-party packages, only built-in packages from the standard library. The code is compact and easily-readable.

Nowhere near the features of youtube-dl (which is like a swiss army knife for downloading videos off the internet), but cool nonetheless. You can read the entirety of GoTube’s source code in a single sitting, which makes it great for learning and tinkering.

Dave Cheney dave.cheney.net

The Zen of Go

How do you write good code? How do you know when you’ve written good code? Dave Cheney writes this with inspiration from PEP 20 - The Zen of Python.

If there’s a continuum between good and bad, how to do we know what the good parts are? What are its properties, its attributes, its hallmarks, its patterns, and its idioms?

Which brings me to idiomatic Go. To say that something is idiomatic is to say that it follows the style of the time. If something is not idiomatic, it is not following the prevailing style. It is unfashionable.

More importantly, to say to someone that their code is not idiomatic does not explain why it’s not idiomatic. Why is this?

JavaScript github.com

An extremely fast JavaScript bundler and minifier

Why build another JavaScript build tool? The current build tools for the web are at least an order of magnitude slower than they should be. I’m hoping that this project serves as an “existence proof” that our JavaScript tooling can be much, much faster.

According to the author, esbuild is fast because..

  1. it’s written in Go
  2. much of the work is done in parallel
  3. it takes very few passes and avoids data transformations
  4. it was coded with performance in mind
An extremely fast JavaScript bundler and minifier

Go github.com

Fiber – an Express inspired web framework for gophers

I know the Go community isn’t one for frameworks, but as a long time framework user myself, I’ve never quite understood the resistance. Fiber doesn’t hide the ball. It comes right out and says “this is a web framework written in Go”. Here’s the philosophy behind that:

New gophers that make the switch from Node.js to Go are dealing with a learning curve before they can start building their web applications or microservices. Fiber, as a web framework, was created with the idea of minimalism and follow UNIX way, so that new gophers can quickly enter the world of Go with a warm and trusted welcome.

Fiber is inspired by Express, the most popular web framework on the Internet. We combined the ease of Express and raw performance of Go. If you have ever implemented a web application on Node.js (using Express or similar), then many methods and principles will seem very common to you.

Rust blog.discordapp.com

Why Discord is switching from Go to Rust

The TLDR of their reasoning is Go’s garbage collection was causing performance problems at scale. Since Rust doesn’t have a garbage collector, it allowed the team to manage their memory use more effectively. Their results were… uplifting:

Remarkably, we had only put very basic thought into optimization as the Rust version was written. Even with just basic optimization, Rust was able to outperform the hyper hand-tuned Go version. This is a huge testament to how easy it is to write efficient programs with Rust compared to the deep dive we had to do with Go.

This is not a Go sucks switch to Rust story. It is a well-reasoned argument for using one technology over the other when it makes sense to do so.

When starting a new project or software component, we consider using Rust. Of course, we only use it where it makes sense.

Dave Cheney the-zen-of-go.netlify.com

The Zen of Go

Dave Cheney’s ten engineering values for writing simple, readable, and maintainable Go code. Some of these apply outside of Go, as well. For instance, Simplicity matters:

Simplicity is not a synonym for unsophisticated. Simple doesn’t mean crude, it means readable and maintainable. When it is possible to choose, defer to the simpler solution.

(Originally presented at GopherCon Israel 2020.)

GitHub github.com

The official GitHub CLI is now in beta

gh brings many of GitHub’s concepts to the terminal. You know, things like pull requests and issues. The tool is still under heavy development and they’re looking for feedback. If you’re an early adopter, this is the perfect time to get involved and let your voice be heard. Oh, and if you’ve been using hub for years already, here’s how the new shiny compares:

gh is a new project for us to explore what an official GitHub CLI tool can look like with a fundamentally different design. While both tools bring GitHub to the terminal, hub behaves as a proxy to git and gh is a standalone tool.

The official GitHub CLI is now in beta

Robert Griesemer blog.golang.org

Proposals for Go 1.15

Robert Griesemer writes on the Go blog for the Go team.

We are close to the Go 1.14 release, planned for February assuming all goes well, with an RC1 candidate almost ready. … The primary goals for Go remain package and version management, better error handling support, and generics. Module support is in good shape and getting better with each day, and we are also making progress on the generics front (more on that later this year)…

Brad Fitzpatrick bradfitz.com

Brad Fitzpatrick is leaving Google

But why?

Little bored. Not learning as much as I used to. I’ve been doing the same thing too long and need a change. It’d be nice to primarily work in Go rather than work on Go.

When I first joined Google it was a chaotic first couple years while I learned Google’s internal codebase, build system, a bunch of new languages, Borg, Bigtable, etc. Then I joined Android it was fun/learning chaos again. Go was the same when I joined and it was a new, fast-moving experiment. Now Go is very popular, stable…

Go github.com

Simple web statistics. No tracking of personal data

GoatCounter is a web analytics platform, roughly similar to Google Analytics or Matomo. It aims to give meaningful privacy-friendly web analytics for business purposes, while still staying usable for non-technical users to use on personal websites. The choices that currently exist are between freely hosted but with problematic privacy (e.g. Google Analytics), hosting your own complex software or paying $19/month (e.g. Matomo), or extremely simplistic “vanity statistics”.

There’s a free hosted offering for non-commercial use. For those running businesses, self-host the thing. Live demo here.

Filippo Valsorda github.com

age is a simple, modern, and secure file encryption tool

It features small explicit keys, no config options, and UNIX-style composability.

$ age-keygen -o key.txt
Public key: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
$ tar cvz ~/data | age -r age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p > data.tar.gz.age
$ age -d -i key.txt data.tar.gz.age > data.tar.gz

If Rust is more your thing, check out the perfectly named port: rage.

Go blog.jse.li

Building a BitTorrent client from the ground up in Go

What is the complete path between visiting thepiratebay and sublimating an mp3 file from thin air? In this post, we’ll implement enough of the BitTorrent protocol to download Debian.

It isn’t a full-fledged client (no magnet links, no multi-file torrents, no seeding), but that makes it an excellent candidate for reading and learning. Here’s the resulting source code.

Kubernetes github.com

A chaos engineering platform for Kubernetes

Chaos Mesh is a cloud-native Chaos Engineering platform that orchestrates chaos on Kubernetes environments. At the current stage, it has the following components:

  • Chaos Operator: the core component for chaos orchestration. Fully open sourced.
  • Chaos Dashboard: a visualized panel that shows the impacts of chaos experiments on the online services of the system; under development; curently only supports chaos experiments on TiDB(https://github.com/pingcap/tidb).

For the uninitiated, chaos engineering is when you unleash havoc on your system to prove out its resiliency (or lack thereof).

A chaos engineering platform for Kubernetes

Go github.com

A better way to handle, trace, and log errors in Go

This package is intended to give you more control over error handling via error wrapping, stack tracing, and output formatting. Basic error wrapping was added in Go 1.13, but it omitted user-friendly Wrap methods and built-in stack tracing. Other error packages provide some of the features found in eris but without flexible control over error output formatting. This package provides default string and JSON formatters with options to control things like separators and stack trace output. However, it also provides an option to write custom formatters via eris.Unpack.

0:00 / 0:00