Go in Practice guides you through 70 real-world techniques in key areas like package management, microservice communication, and more. Following a cookbook-style Problem/Solution/Discussion format, this practical handbook builds on the foundational concepts of the Go language and introduces more » specific strategies you can use in your day-to-day applications.
About the Technology
Go may be the perfect systems language. Built with simplicity, concurrency, and modern applications in mind, Go provides the core tool set for rapidly building web, cloud, and systems applications. If you know a language like Java or C#, it's easy to get started with Go; the trick is finding the practical dirt-under-the-fingernails techniques that you need to build production-ready code.
About the Book
Go in Practice guides you through dozens of real-world techniques in key areas. Following a cookbook-style Problem/Solution/Discussion format, this practical handbook builds on the foundational concepts of the Go language and introduces specific strategies you can use in your day-to-day applications. You'll learn techniques for building web services, using Go in the cloud, testing and debugging, routing, network applications, and much more. After finishing this book, you will be ready to build sophisticated cloud-native Go applications.
* Dozens of specific, practical Golang techniques
* Using Go for devops and cloudops
* Writing RESTful web services and microservices
* Practical web dev techniques
About the Reader
Written for experienced developers who have already started exploring Go and want to use it effectively in a production setting.
About the Authors
Matt Farina is a software architect at Deis. Matt Butcher is a Principal Engineer in the Advanced Technology Group at Hewlett Packard Enterprise. They are both authors, speakers, and regular open source contributors.
Table of Contents
1. PART 1 - BACKGROUND AND FUNDAMENTALS
2. Getting into Go
3. A solid foundation
4. Concurrency in Go
5. PART 2 - WELL-ROUNDED APPLICATIONS
6. Handling errors and panic
7. Debugging and testing
8. PART 3 - AN INTERFACE FOR YOUR APPLICATIONS
9. HTML and email template patterns
10. Serving and receiving assets and forms
11. Working with web services
12. PART 4 - TAKING YOUR APPLICATIONS TO THE CLOUD
13. Using the cloud
14. Communication between cloud services
15. Reflection and code generation « less
Go Web Programming teaches you how to build scalable, high-performance web applications in Go using modern design principles.
About the Technology
The Go language handles the demands of scalable, high-performance web applications by providing clean and fast compiled code, garbage collection, more » a simple concurrency model, and a fantastic standard library. It's perfect for writing microservices or building scalable, maintainable systems.
About the Book
Go Web Programming teaches you how to build web applications in Go using modern design principles. You'll learn how to implement the dependency injection design pattern for writing test doubles, use concurrency in web applications, and create and consume JSON and XML in web services. Along the way, you'll discover how to minimize your dependence on external frameworks, and you'll pick up valuable productivity techniques for testing and deploying your applications.
* Testing and benchmarking
* Using concurrency
* Deploying to standalone servers, PaaS, and Docker
* Dozens of tips, tricks, and techniques
About the Reader
This book assumes you're familiar with Go language basics and the general concepts of web development.
About the Author
Sau Sheong Chang is Managing Director of Digital Technology at Singapore Power and an active contributor to the Ruby and Go communities.
Table of Contents
1. PART 1 GO AND WEB APPLICATIONS
2. Go and web applications
3. Go ChitChat
4. PART 2 BASIC WEB APPLICATIONS
5. Handling requests
6. Processing requests
7. Displaying content
8. Storing data
9. PART 3 BEING REAL
10. Go web services
11. Testing your application
12. Leveraging Go concurrency
13. Deploying Go « less
Build real-world, production-ready solutions by harnessing the powerful features of Go
***** About This Book *****
* An easy-to-follow guide that provides everything a developer needs to know to build end-to-end web applications in Go
* Write interesting and clever, but simple code, and learn skills and techniques that are directly transferable to your own projects
* A practical approach more » to utilize application scaffolding to design highly scalable programs that are deeply rooted in go routines and channels
***** Who This Book Is For *****
This book is intended for developers who are new to Go, but have previous experience of building web applications and APIs.
***** What You Will Learn *****
* Build a fully featured REST API to enable client-side single page apps
* Utilize TLS to build reliable and secure sites
* Learn to apply the nuances of the Go language to implement a wide range of start-up quality projects
* Create websites and data services capable of massive scale using Go's net/http package, exploring RESTful patterns as well as low-latency
* Interact with a variety of remote web services to consume capabilities ranging from authentication and authorization to a fully functioning thesaurus
* Explore the core syntaxes and language features that enable concurrency in Go
* Understand when and where to use concurrency to keep data consistent and applications non-blocking, responsive, and reliable
* Utilize advanced concurrency patterns and best practices to stay low-level without compromising the simplicity of Go itself
***** In Detail *****
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. It is a statically typed language with syntax loosely derived from that of C, adding garbage collection, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library.
This course starts with a walkthrough of the topics most critical to anyone building a new web application. Whether it's keeping your application secure, connecting to your database, enabling token-based authentication, or utilizing logic-less templates, this course has you covered.
Scale, performance, and high availability lie at the heart of the projects, and the lessons learned throughout this course will arm you with everything you need to build world-class solutions. It will also take you through the history of concurrency, how Go utilizes it, how Go differs from other languages, and the features and structures of Go's concurrency core. It will make you feel comfortable designing a safe, data-consistent, and high-performance concurrent application in Go.
This course is an invaluable resource to help you understand Go's powerful features to build simple, reliable, secure, and efficient web applications.
***** Style and approach *****
This course is a step-by-step guide, which starts off with the basics of go programming to build web applications and will gradually move on to cover intermediate and advanced topics. You will be going through this smooth transition by building interesting projects along with the authors, discussing significant options, and decisions at each stage, while keeping the programs lean, uncluttered, and as simple as possible. « less
Build Reliable, Scalable Programs
Perfect for beginners familiar with programming basics, this hands-on guide provides an easy introduction to Go, the general-purpose programming language from Google. Author Caleb Doxsey covers the language’s core features with step-by-step instructions and exercises in each chapter to help you practice more » what you learn.
Go is a general-purpose programming language with a clean syntax and advanced features, including concurrency. This book provides the one-on-one support you need to get started with the language, with short, easily digestible chapters that build on one another. By the time you finish this book, not only will you be able to write real Go programs, you'll be ready to tackle advanced techniques.
* Jump into Go basics, including data types, variables, and control structures
* Learn complex types, such as slices, functions, structs, and interfaces
* Explore Go’s core library and learn how to create your own package
* Write tests for your code by using the language’s go test program
* Learn how to run programs concurrently with goroutines and channels
* Get suggestions to help you master the craft of programming « less
Build real-world, production-ready solutions in Go using cutting-edge technology and techniques
Dive headfirst into solving actual enterprise problems and start cutting code from the word go. You will build complete applications around a variety of subjects using a range of different technologies and techniques, all of which are directly applicable to today's tech start-up world.
Scale, performance, more » and high availability lie at the heart of the projects, and the lessons learned throughout this book will arm you with everything you need to build world-class solutions. Well-designed applications and sensible architectures can scale horizontally to cope with the demands of up to millions of users, while avoiding the prohibitive up-front investment that can bring a project to its knees.
***** Who This Book Is For *****
Intended for seasoned Go programmers who want to put their expertise in Go to use to solve big, real-world, modern problems. With a basic understanding of channels and goroutines, you will hone your skills to build tools and programs that are quick and simple. You need not be an expert in distributed systems or technologies in order to deliver solutions capable of great scale. It is assumed that you are familiar with the basic concepts of Go. « less
* The first chapter is a tutorial on the basic concepts of Go, introduced through programs for file I/O and text processing, simple graphics, and web clients and servers.
* Early chapters cover the structural elements of Go programs: syntax, control flow, data types, and the organization of a program into packages, files, and functions. The examples illustrate many packages from the standard library and show how to create new ones of your own. Later chapters explain the package mechanism in more detail, and how to build, test, and maintain projects using the go tool.
* The chapters on methods and interfaces introduce Go’s unconventional approach to object-oriented programming, in which methods can be declared on any type and interfaces are implicitly satisfied. They explain the key principles of encapsulation, composition, and substitutability using realistic examples.
* Two chapters on concurrency present in-depth approaches to this increasingly important topic. The first, which covers the basic mechanisms of goroutines and channels, illustrates the style known as communicating sequential processes for which Go is renowned. The second covers more traditional aspects of concurrency with shared variables. These chapters provide a solid foundation for programmers encountering concurrency for the first time.
* The final two chapters explore lower-level features of Go. One covers the art of metaprogramming using reflection. The other shows how to use the unsafe package to step outside the type system for special situations, and how to use the cgo tool to create Go bindings for C libraries.
The book features hundreds of interesting and practical examples of well-written Go code that cover the whole language, its most important packages, and a wide range of applications. Each chapter has exercises to test your understanding and explore extensions and alternatives. Source code is freely available for download from http://gopl.io/ and may be conveniently fetched, built, and installed using the go get command. « less
Building Scalable Web Apps and RESTful Services
Take a deep dive into web development using the Go programming language to build web apps and RESTful services to create reliable and efficient software. Web Development with Go provides Go language fundamentals and then moves on to advanced web development concepts and successful deployment of Go web more » apps to the cloud.
Web Development with Go will teach you how to develop scalable real-world web apps, RESTful services, and backend systems with Go. The book starts off by covering Go programming language fundamentals as a prerequisite for web development. After a thorough understanding of the basics, the book delves into web development using the built-in package, net/http. With each chapter you’ll be introduced to new concepts for gradually building a real-world web system.
The book further shows you how to integrate Go with other technologies. For example, it provides an overview of using MongoDB as a means of persistent storage, and provides an end-to-end REST API sample as well. Developers looking for a full-fledged web development framework for building web apps will be introduced to Beego. The book then moves on to demonstrate how to deploy web apps to the cloud using the Google Cloud platform. Finally, the book introduces Docker, a revolutionary container technology platform for deploying containerized Go web apps to the cloud.
Web Development with Go provides:
* Fundamentals for building real-world web apps in Go
* Thorough coverage of prerequisites and practical code examples
* Demo web apps for attaining a deeper understanding of web development
* A reference REST API app which can be used to build scalable real-world backend services in Go
* A thorough demonstration of deploying web apps to the Cloud using the Google Cloud platform, and Docker for deploying Go servers
Go is a high-performance language while providing greater level of developer productivity, therefore Web Development with Goequips you with the necessary skills and knowledge required for effectively building robust and efficient web apps by leveraging the features of Go. « less
This book is a short, concise introduction to computer programming using the language Go. Designed by Google, Go is a general purpose programming language with modern features, clean syntax and a robust well-documented common library, making it an ideal language to learn as your first programming la more »nguage. « less
Creating Applications for the 21st Century
Today's most exciting new programming language, Go, is designed from the ground up to help you easily leverage all the power of today's multicore hardware. With this guide, pioneering Go programmer Mark Summerfield shows how to write code that takes full advantage of Go's breakthrough features and idioms.
Both more » a tutorial and a language reference, Programming in Go brings together all the knowledge you need to evaluate Go, think in Go, and write high-performance software with Go. Summerfield presents multiple idiom comparisons showing exactly how Go improves upon older languages, calling special attention to Go's key innovations. Along the way, he explains everything from the absolute basics through Go's lock-free channel-based concurrency and its flexible and unusual duck-typing type-safe approach to object-orientation. « less
This guide gives you the code "phrases" you need to quickly and effectively complete a wide variety of projects with Go, today's most exciting new programming language.
Tested, easy-to-adapt code examples illuminate every step of Go development, helping you write highly scalable, concurrent software. more » You'll master Go-specific idioms for working with strings, collections, arrays, error handling, goroutines, slices, maps, channels, numbers, dates, times, files, networking, web apps, the runtime, and more. « less