Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Go CookBook

You're reading from   Go CookBook Top techniques and practical solutions for real-life Go programming problems

Arrow left icon
Product type Paperback
Published in Dec 2024
Publisher Packt
ISBN-13 9781835464397
Length
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Burak Serdar Burak Serdar
Author Profile Icon Burak Serdar
Burak Serdar
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Chapter 1: Project Organization 2. Chapter 2: Working with Strings FREE CHAPTER 3. Chapter 3: Working with Date and Time 4. Chapter 4: Working with Arrays, Slices, and Maps 5. Chapter 5: Working with Types, Structs, and Interfaces 6. Chapter 6: Working with Generics 7. Chapter 7: Concurrency 8. Chapter 8: Errors and Panics 9. Chapter 9: The Context Package 10. Chapter 10: Working with Large Data 11. Chapter 11: Working with JSON 12. Chapter 12: Processes 13. Chapter 13: Network Programming 14. Chapter 14: Streaming Input/Output 15. Chapter 15: Databases 16. Chapter 16: Logging 17. Chapter 17: Testing, Benchmarking, and Profiling 18. Index 19. Other Books You May Enjoy

What this book covers

Chapter 1, Project Organization, covers modules, packages, source tree organization, importing packages, versioning modules, and workspaces.

Chapter 2, Working with Strings, contains recipes showing how to work with strings, internationalization, encoding, regular expressions, parsing, and generating formatted text using templates.

Chapter 3, Working with Date and Time, shows how to work with date, time, and duration values correctly with time zone considerations, formatting/parsing date and time values, performing periodic tasks, and scheduling functions to run later.

Chapter 4, Working with Arrays, Slices, and Maps, introduces the basic container types that are the building blocks for many data structures.

Chapter 5, Working with Types, Structs, and Interfaces, shows how to define new types, extending existing types to share functionality, interfaces, and their uses. In particular, this chapter includes the two approaches to using interfaces, namely, interfaces as contracts and defining interfaces where they are used.

Chapter 6, Working with Generics, introduces the basic recipes for writing generic functions and generic types with examples.

Chapter 7, Concurrency, includes basic recipes to write concurrent programs using goroutines and channels. Mutual exclusion using mutexes is also discussed here.

Chapter 8, Errors and Panics, shows generating errors, passing errors around, handling them, and organizing errors in a project. It also discusses how to generate and deal with panics.

Chapter 9, The Context Package, introduces the Go’s Context which is useful for controlling request lifecycle and passing request-scoped values within an application in a concurrent program.

Chapter 10, Working with Large Data, includes recipes for working with large amounts of data in a concurrent setting using worker pools and concurrent pipelines.

Chapter 11, Working with JSON, includes recipes for encoding and decoding JSON, marshaling/unmarshaling simple and complex data types, working with custom serialization logic, encoding/decoding polymorphic structures, and streaming JSON data.

Chapter 12, Processes, shows how to run and interact with external programs, working with environment variables, working with pipes, and graceful termination using signals.

Chapter 13, Network Programming, gives recipes for TCP and UDP servers and clients, working with TLS, deadlines, HTTP client/servers, request multiplexing, and HTML forms.

Chapter 14, Streaming Input/Output, includes recipes using reads and writers, working with files and the file system, and pipes.

Chapter 15, Databases, shows how to interact with an SQL database using the standard library packages in a secure way.

Chapter 16, Logging, has recipes showing the common uses of the standard library log and slog packages.

Chapter 17, Testing, Benchmarking, and Profiling, gives recipes on writing and running unit tests, testing HTTP servers, benchmarking, and profiling

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image