O'Reilly logo

Go: Design Patterns for Real-World Projects by Mat Ryer, Mario Castro Contreras, Vladimir Vivien

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

This chapter condenses several important notions about creating networked services in Go. It starts with a walkthrough of Go's net package including the net.Conn type to create a connection between network nodes, the net.Dial function to connect to a remote service, and the net.Listen function to handle incoming connections from a client. The chapter continues to cover different implementations of clients and server programs and shows the implications of creating custom protocols directly over raw TCP versus using an existing protocol such as HTTP with JSON data format.

The next chapter takes a different direction. It explores the packages, types, functions, and tools that are available in Go to facilitate source code testing.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required