Tsoukalos | Mastering Go | E-Book | sack.de
E-Book

E-Book, Englisch, 740 Seiten

Tsoukalos Mastering Go

Leverage Go's expertise for advanced utilities, empowering you to develop professional software
4. Auflage 2024
ISBN: 978-1-80512-264-7
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection

Leverage Go's expertise for advanced utilities, empowering you to develop professional software

E-Book, Englisch, 740 Seiten

ISBN: 978-1-80512-264-7
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection



Mastering Go, now in its fourth edition, remains the go-to resource for real-world Go development. This comprehensive guide delves into advanced Go concepts, including RESTful servers, and Go memory management. This edition brings new chapters on Go Generics and fuzzy Testing, and an enriched exploration of efficiency and performance. As you work your way through the chapters, you will gain confidence and a deep understanding of advanced Go topics, including concurrency and the operation of the Garbage Collector, using Go with Docker, writing powerful command-line utilities, working with JavaScript Object Notation (JSON) data, and interacting with databases.

You will be engaged in real-world exercises, build network servers, and develop robust command-line utilities. With in-depth chapters on RESTful services, the WebSocket protocol, and Go internals, you are going to master Go's nuances, optimization, and observability. You will also elevate your skills in efficiency, performance, and advanced testing.

With the help of Mastering Go, you will become an expert Go programmer by building Go systems and implementing advanced Go techniques in your projects.

Tsoukalos Mastering Go jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


Table of Contents - A Quick Introduction to Go
- Basic Go Data Types
- Composite Data Types
- Go Generics
- Reflection and Interfaces
- Go Packages and Functions
- Telling a UNIX System What to Do
- Go Concurrency
- Building Web Services
- Working with TCP/IP and WebSocket
- Working with REST APIs
- Code Testing and Profiling
- Fuzz Testing and Observability
- Efficiency and Performance
- Changes in Recent Go Versions
- Appendix


Preface


Welcome to the fourth edition of ! As the Go programming language continues to evolve and gain popularity, I am delighted to present an updated edition of this book.

In the rapidly changing landscape of technology, Go has emerged as a language of choice for building scalable, performant, and maintainable software. Whether you are a seasoned Go developer looking to deepen your expertise or a newcomer eager to master the intricacies of the language, this book is your comprehensive guide.

If you have an older edition of apart from the first edition, which is now pretty old, do not throw it away just because is out. Go has not changed that much and both the second and third editions can still be useful and relevant. However, is better in many aspects than all previous editions and includes information about the latest Go versions, which you are not going to find in the previous editions of the book.

There exist many exciting topics in this latest edition, including writing RESTful services, writing a statistics application, and working with eBPF, as well as an entirely new chapter on fuzz testing and observability.

I tried to include the right amount of theory and hands-on content—but only you, the reader, can tell if I have succeeded or not. Try to do the exercises located at the end of each chapter and do not hesitate to contact me about ways or ideas to make future editions of this book even better.

Thank you for choosing to pick up . Let us dive in and unlock the full potential of Go together. Happy coding!

Who this book is for


This book is for amateur and intermediate Go programmers who want to take their Go knowledge to the next level, as well as developers in other programming languages who want to learn Go.

If this is your first programming book ever, you might have some issues following it and a second reading might be required to fully absorb all the presented knowledge.

Learning by doing is a fundamental principle of studying any programming language. Throughout the book, you will find practical examples and hands-on exercises that illustrate key concepts and encourage you to apply your knowledge to real-world scenarios.

One way or another, prepare to work and learn and fail and then work and learn and fail some more. After all, life is not that different from programming.

What this book covers


, , begins by discussing the history of Go, important characteristics of Go, and the advantages of Go, before describing the and utilities and explaining how we can compile and execute Go programs. Then, the chapter discusses about controlling program flow, printing output and getting user input, working with command line arguments, and using log files. In the last part of , we develop a basic version of a statistics application that we are going to keep improving in forthcoming chapters.

, , discusses the basic data types of Go, both numeric and non-numeric; arrays and slices that allow you to group data of the same date; Go pointers; constants; and working with dates and times. The last part of the chapter is about generating random numbers and populating the statistics application with random data.

, , begins by teaching you about maps, before going into structures and the keyword. Additionally, it talks about regular expressions, pattern matching, and working with CSV files. Last, it improves the statistics application by adding data persistency to it.

, , is about Generics and how to use the new syntax to write generic functions and define generic data types. This chapter also presents the package, the package, and the package, which are all implemented using generics to work with as many data types as possible.

, , is about reflection, interfaces, and type methods, which are functions attached to data types. The chapter also covers the use of the interface for sorting slices, the use of the empty interface, type assertions, type switches, and the data type. Additionally, we discuss how Go can mimic some object-oriented concepts before improving the statistics application. This chapter also compares generics with interfaces and reflection.

, , is all about packages, modules, and functions, which are the main elements of packages. Among other things, we create a Go package for interacting with a SQLite3 database, create documentation for it, and explain the use of the sometimes-tricky keyword. Last, we talk about Workspaces, which is a relatively new Go feature.

, , is about Systems Programming, which includes subjects such as working with command line arguments, handling UNIX signals, file input and output, the and interfaces, and the use of the and packages. Last, we update the statistics application to use JSON data and convert it into a proper command line utility with the help of the package.

, , discusses goroutines, channels, and pipelines. We learn about the differences between processes, threads, and goroutines, the package, and the way the Go scheduler operates. Additionally, we explore the use of the keyword and we discuss the various of Go channels as well as shared memory, mutexes, the type, and the type. The rest of the chapter talks about the package, the package, worker pools, how to time out goroutines, and how to detect race conditions.

, , discusses the package, the development of web servers and web services, the creation of web clients, and the timing out of HTTP connections. We also convert the statistics application into a web service and create a command line client for it.

, , is about the package, TCP/IP, the TCP and UDP protocols, as well as the WebSocket protocol and working with RabbitMQ. We develop lots of practical servers and clients in this chapter.

, , is all about working with REST APIs and RESTful services. We learn how to define REST APIs and develop powerful concurrent RESTful servers as well as command line utilities that act as clients to RESTful services.

, , discusses code testing, code optimization, and code profiling, as well as cross compilation, creating example functions, the use of , and finding unreachable Go code.

, , talks about fuzz testing, which is a relatively new addition to the Go programming language, and about observability, which refers to the ability to understand, measure, and analyze the internal state and behavior of a system based on its external outputs or observable signals.

, , is about benchmarking Go code, understanding the Go memory model, and eliminating memory leaks. The chapter also includes the development of an eBPF utility—eBPF has become a foundational technology for improving observability, security, and performance in modern Linux systems.

, , is about the language changes, additions, and improvements in the latest Go versions and it will help you understand how Go is evolving over time.

, , talks about the operation of the Go Garbage Collector and illustrates how this Go component can affect the performance of your code.

To get the most out of this book


This book requires a modern computer with a relatively recent Go version installed, which includes any machine running Mac OS X, macOS, or Linux, as well as familiarity with your operating system, its filesystem, and . Most of the presented code also runs on Microsoft Windows machines without any changes.

As you embark on your journey to mastering Go, I encourage you to experiment, ask questions, and engage with the material actively. The Go programming language offers a refreshing blend of simplicity and power, and I am confident that this book will provide you with the knowledge and skills needed to become a proficient Go developer.

Download the example code files


The code bundle for the book is hosted on GitHub at https://github.com/mactsouk/mGo4th. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images


We also provide a PDF file that has color images of the screenshots/diagrams used in this book....


Tsoukalos Mihalis:

Mihalis Tsoukalos holds a BSc in Mathematics from the University of Patras and an MSc in IT from University College London. His previous books Go Systems Programming and Mastering Go have become must-reads for UNIX and Linux systems professionals. He works as a UNIX systems engineer and a technical author. He enjoys writing technical articles and has written for Sys Admin, MacTech, C/C++ Users Journal, USENIX;login:, Linux Journal, Linux User and Developer, Linux Format, and Linux Voice. His research interests include time series data mining, time series indexing, and databases.



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.