The Best Go Content on the Internet


String Matching

Contributed by

How do you search for a string? If it’s just once, strings.Index(text, pattern) is probably your best option. The standard library currently uses Rabin-Karp to search the text for the pattern. However, there are lots of different cases for string searching, each of which has its own set of “best” algorithms. Fortunately for us, many of them already have implementations in Go. index/suffixarray What if you had a single text you wanted to do lots of searches through for different patterns?

Read more...

Git2go inception

Contributed by

How many levels of inception we need to master git? This tutorial that explains how to use git2go to publish an article for the Go Advent 2014. Git2go implements go bindings for libgit2, a pure C implementation of the Git core methods. This is important because, unlike other libraries, libgit2 doesn’t talk with any git binary. You won’t find the installation complicated if you’ve worked already with other C libraries. I recommend you to read the installation section in the readme.

Read more...

Delve: Go debugger

Contributed by

Delve Delve is a Go debugger. Currently the project is in beta, with most of the functionality implemented, and various improvements and platform support on the way. Why I started work on Delve sometime shortly after Gophercon 2014. Delve began as a fun and interesting project to hack on, and has since become a useful tool with a lot of potential. Delve was created to address issues with debugging Go programs with GDB.

Read more...

Handwritten Parsers & Lexers in Go

Contributed by

Handwritten Parsers & Lexers in Go In these days of web apps and REST APIs it seems that writing parsers is a dying art. You may think parsers are a complex undertaking only reserved for programming language designers but I’d like to dispel this idea. Over the past few years I’ve written parsers for JSON, CSS3, and database query languages and the more that I write parsers the more that I love them.

Read more...

Probabilistic Data Structures for Go

Contributed by

Imagine you had access logs for a very high traffic website. How would you determine how many different IP addresses accessed your site? Or how many hits from a particular IP? Or which ones accessed it the most? Assuming IPv4 addresses, you could use a map[uint32]int to maintain the counts, but that could end up using a lot of memory. It’s certainly possible to have a map with 4 billion entries, and a real log server wouldn’t have accesses from every single valid IP address, but the problem still exists.

Read more...

Using Go for Anomaly Detection

Contributed by

As engineers, we need to know how our applications and services are performing in realtime and isolate any problems as quickly as possible. While there is a plethora of tools to collect, store and graph metrics from infrastructure, there are fewer tools for performing analysis on these metrics. Anomaly detection, currently a hot topic in web operations circles, is concerned with automated detection of anomalous circumstances which could indicate a problem.

Read more...

Go at Sourcegraph - Serving Terabytes of Git Data, Tracing App Performance, and Caching HTTP Resources

Contributed by

Sourcegraph is a code search and review application that supports and analyzes code in multiple languages: Go, Python, Java, Ruby, JavaScript, and soon more. Even though we have experts in each language on our team, Sourcegraph’s core has been written in Go since day one, and we’ve chosen Go for each new project and system we’ve built. We’ll run through all of the major open-source systems and projects we’ve built within Sourcegraph in Go.

Read more...

Go at Datadog

Contributed by

Go at Datadog In the last year, Go has started to supplant parts of our intake pipeline at Datadog that were previously written in Python. The embrace of Go by users of dynamic languages is well documented, generally focusing on the performance and memory usage benefits of switching to a compiled language that lacks heavy per-object overhead. We could tell the same story. Datadog is a SaaS cloud monitoring and metrics platform, and because of an increasing focus on horizontal scaling in the cloud, our users have lots of servers, and their servers send us lots of data.

Read more...

Advanced Reflection with Go at HashiCorp

Contributed by

Advanced Reflection with Go at HashiCorp HashiCorp builds a diverse set of popular DevOps tools written in Go: Packer, Serf, Consul, and Terraform. While these tools range from desktop software to highly scalable distributed systems, their internals all have one thing in common: they use reflection, and a lot of it. In this post, I’ll share the libraries and techniques we use at HashiCorp to get the most out of reflection, all while being safe and efficient.

Read more...

Go at CoreOS

Contributed by

Go at CoreOS When we launched the CoreOS project we knew from the very beginning that everything we built would be written in Go. This was not to make a fashion statement, but rather Go happened to be the perfect platform for reaching our goals – to build products that make distributed computing as easy as installing a Linux distro. It’s been almost 10 years since a new Linux distro hit the scene, and during that time Python was the language of choice.

Read more...