Chapter 7. Go

Earlier editions of this book covered a wide variety of tools and techniques within the world of network automation. Even at that time (when automation was still largely considered to be a nascent discipline), a multitude of tools existed to address the most common use cases. However, an alternative approach has always existed for use cases where those tools aren’t sufficient on their own. Given Python’s popularity and approachability, including a chapter focusing on that language makes sense. With this knowledge, network automation professionals always have the option of writing custom Python scripts to fill in any gaps in the existing ecosystem, should the existing tools prove insufficient on their own.

However, Python is no longer the only kid on the block. These days, another programming language can often be found in network automation initiatives of any scale: Go. Initially designed by Google in 2007, Go is used today by thousands of companies around the world. According to the 2021 Go Developer Survey, 76% of respondents use Go at work. As might be expected, this includes a healthy percentage of technology-focused companies, but also includes industries like healthcare, retail, and manufacturing. Among many others, nearly 40% of respondents said they use Go for automation or scripting use cases. Clearly, something powerful in this relatively young language warrants a closer look for our purposes in the world of network automation.

Before we dig into Go, you ...

Get Network Programmability and Automation, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.