The Best Go Content on the Internet


Automi: Stream Processing Over Go Channels

Contributed by

As a Go programmer, one of the features that attracted me to the language is the channel-based idiom used for goroutine communications. Channels, along with goroutines, form the basis for the Go concurrency primitives. If you are reading this post, you are likely familiar with the Go proverb: Do not communicate by sharing memory; instead share memory by communicating Using channels, to communicate between concurrently running goroutines, promotes data safety without the brittle choreography imposed by synchronization primitives when sharing memory directly.

Read more...

Writing an SSH server in Go

Contributed by

When I’m working on the Gogs project, there is a need of builtin SSH server, which allows users to preform Git-only operations through key-based authentication. The available resources on the web are all minimal examples and do not fit this specific requirement. Therefore, I think it’s worth sharing my experiences to make your life easier in case you just run into same problem as mine. The code structure is pretty much same to the examples you can find on the web.

Read more...

Manage Dependencies Like Other Languages With Glide

Contributed by

Managing dependent packages in most of the popular and new languages have common patterns implemented by package managers. If you need to manage packages in Python, JavaScript, Rust, Java, Ruby, C# (via .NET), and numerous other languages it’s a similar activity. There are config files, versions and ranges, pinning to versions, and per project package versions. These patterns are found in languages using both static and dynamic typing and work for both compiled and interpreted languages.

Read more...

gopy: extending CPython with Go

Contributed by

Applications and libraries do not live in a vacuum. This is of course true for Go packages and commands. More often than not, you need your code to interact with legacy applications or old and battle tested libraries. The standard library of Go provides many facilities for interacting with such entities: encoding/json, encoding/xml or net/rpc. Reach out of the standard library and you have ProtoBuf. All of these facilities meant to arrange for some kind of IPC (Inter-Program Communication) and before Go-1.

Read more...

NATS: High Performance Cloud Native Messaging Written in Go

Contributed by

Performance at scale is critically important for anybody attempting to build distributed systems today. Pieces of a given service might be spread across physical or virtual infrastructure, or might be comprised of thousands or even millions of devices (Internet of Things). But, to the end user they need to operate seamlessly - as though they are one entity. This requires extremely fast, lightweight, always-on communication. NATS is an extremely lightweight, and massively scalable Publish/Subscribe (PubSub) messaging system for Cloud Native applications.

Read more...

Generate and Use Free TLS Certificates with Lego

Contributed by

If your Go program uses the transport layer of the network at all—whether to serve static files, an API, or something else over the wire—you should be encrypting connections using TLS. Hopefully this is obvious by now. But developers still don’t do it. Why? Because TLS (formerly “SSL”) certificates cost money and require manual labor to obtain, install, and maintain. Besides, there’s no reason to encrypt unless you collect or send sensitive data, right?

Read more...

test2doc: Generate Your API Docs

Contributed by

API docs are important. We all know that. They are also painful and tedious to maintain. When your docs aren’t accurate, you get more questions. And everyone loses time. I’ve always thought of unit tests as a great source of documentation. But the non-Go engineers consuming my API don’t often agree. Yet most of the same information is there: request format: HTTP method URI query params request headers request body response format: status code response headers response body

Read more...

Integrating Go in a Yocto-based project

Contributed by

From its website, Yocto, part of the Linux Foundation Collaborative Projects, is an open source collaboration project that provides templates, tools and methods to help you create custom Linux-based systems for embedded products regardless of the hardware architecture. Given Go’s wonderful support for cross compilation, the two are like a match made in heaven. While not a requirement, Yocto-based projects have a strong preference for building everything from source, including the toolchain.

Read more...

Composable command-line tools

Contributed by

Go’s simplicity and exhaustive standard library means writing command-line tools is easy and enjoyable. Following the Go philosophy, if you write programs that are small and focussed, you can end up with a pretty powerful little toolbelt of utilities. But pretty soon, programs will need to communicate with each other in some way; to share data or issue commands. But before you invest in a messaging queue and heavily complicate your otherwise neat little world, consider using a staple of the OS; pipes (stdin standard in and stdout standard out - and stderr standard error for if things go wrong).

Read more...

Announcing GopherCon 2016

Contributed by

GopherCon 2016 will take place at the Colorado Convention Center in Denver, Colorado on July 11th through July 13th, 2016. We’ve listened to the feedback you gave us from GopherCon 2015 and want to explain the changes we’re putting in place for GopherCon 2016. Multiple tracks The big change for 2016 is the introduction of multiple tracks during the afternoon sessions. On Day 1 and Day 2 we will feature 30-minute plenary talks in the main theatre until lunch time.

Read more...