
Effective Go Recipes
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Cover
- Table of Contents
- Preface
- Cooking with Go
- Who Are You?
- Reading This Book
- A Foolish Consistency Is the Hobgoblin of Little Minds
- Wait! There's More! (online)
- 1. Reading and Writing (I/O)
- Recipe 1. Using In-Memory Readers and Writers to Support []byte
- Recipe 2. Compressing Old Log Files
- Recipe 3. Using bytes.Buffer to Generate SQL
- Recipe 4. Conditionally Decompressing Files
- Recipe 5. Implementing io.Writer for Frequency Calculation
- Recipe 6. Using os.Pipe for Dynamic Data Generation
- Recipe 7. Searching in a Memory Mapped File
- Final Thoughts
- 2. Serializing Data
- Recipe 8. Streaming Events with encoding/gob
- Recipe 9. Parsing Complex JSON Documents
- Recipe 10. Streaming JSON
- Recipe 11. Handling Missing Values in JSON
- Recipe 12. Serializing Custom Types
- Recipe 13. Unmarshaling Dynamic Types
- Recipe 14. Parsing Struct Tags
- Final Thoughts
- 3. Utilizing HTTP
- Recipe 15. Making GET Requests
- Recipe 16. Streaming POST Requests
- Recipe 17. Writing Middleware to Monitor Performance
- Recipe 18. Setting Server Timeouts
- Recipe 19. Supporting Several API Versions in the Same HTTP Server
- Final Thoughts
- 4. Working with Text
- Recipe 20. Using Formatting Verbs for Better Output
- Recipe 21. Adding String Representation to Your Types
- Recipe 22. Detecting Encoding
- Recipe 23. Using Regular Expressions to Convert camelCase to lower_with_underscore
- Recipe 24. Folding Strings for Case-Insensitive Comparison
- Recipe 25. Using Unicode Normalization for Comparison
- Final Thoughts
- 5. Working with Functions
- Recipe 26. Using a Function Registry
- Recipe 27. Using Functions as Options
- Recipe 28. Using Closures to Provide Options with Arguments
- Recipe 29. Passing Notifications with Functions
- Recipe 30. Accessing Unexported Functions
- Final Thoughts
- 6. Working with Basic Types
- Recipe 31. Using the comma, ok Paradigm
- Recipe 32. Using a Slice to Implement a Stack
- Recipe 33. Calculating Cumulative Sum
- Recipe 34. Serializing Time to/from JSON
- Recipe 35. Using Composite Keys in Maps
- Recipe 36. Parsing Time Strings
- Final Thoughts
- 7. Working with Structs, Methods, and Interfaces
- Recipe 37. Using Ad Hoc Interfaces
- Recipe 38. Wrapping the http.ResponseWriter Interface
- Recipe 39. Using Generics to Reduce Code Size
- Recipe 40. Using Generics for Type-Safe Data Structures
- Recipe 41. Using Generics for Better Type Safety
- Final Thoughts
- 8. Working with Errors
- Recipe 42. Handling and Returning Errors
- Recipe 43. Handling Panics
- Recipe 44. Handling Panics in Goroutines
- Recipe 45. Checking Errors
- Recipe 46. Wrapping Errors
- Final Thoughts
- 9. Using Goroutines, Channels, and Context for Concurrency
- Recipe 47. Converting Sequential Code to Parallel
- Recipe 48. Limiting the Number of Goroutines with a Buffered Channel
- Recipe 49. Using a Worker Pool with Channels
- Recipe 50. Using context.Context for Timeouts
- Recipe 51. Passing Logger with Request ID in Context
- Final Thoughts
- 10. Lower-Level Concurrency
- Recipe 52. Writing Idempotent Functions with sync.Once
- Recipe 53. Waiting for Job Completion with sync.WaitGroup
- Recipe 54. Allowing Multiple Readers with sync.RWMutex
- Recipe 55. Using the Race Detector
- Recipe 56. Using sync/atomic for a Faster Now
- Final Thoughts
- 11. Working with Sockets
- Recipe 57. Accepting Files over TCP Sockets
- Recipe 58. Sending Files over TCP Sockets
- Recipe 59. Writing a Serverless Platform
- Recipe 60. Reading Time with NTP over UDP
- Final Thoughts
- 12. Communicating with Non-Go Code
- Recipe 61. Using os/exec to Ping Servers
- Recipe 62. Calling C Functions to AlignText
- Recipe 63. Redirecting Subprocess stdin and stdout to Prototype a Calculator
- Recipe 64. Stemming Words Using a C Library
- Final Thoughts
- 13. Testing Your Code
- Recipe 65. Conditionally Running Continuous Integration Tests
- Recipe 66. Reading Test Cases from a File
- Recipe 67. Fuzzing Bugs Away
- Recipe 68. Mocking HTTP Client Calls
- Recipe 69. Writing Global Setup/Teardown Functions
- Recipe 70. Running Services in Testing
- Recipe 71. Writing a Linter
- Final Thoughts
- 14. Building Applications
- Recipe 72. Embedding Assets in Your Binary
- Recipe 73. Injecting Version to Your Executable
- Recipe 74. Ensuring Static Builds
- Recipe 75. Using Build Tags for Conditional Builds
- Recipe 76. Building Executables for Different Platforms
- Recipe 77. Generating Code
- Final Thoughts
- 15. Shipping Your Code
- Recipe 78. Configuring Your Application
- Recipe 79. Patching Dependencies
- Recipe 80. Packaging Applications in Docker
- Recipe 81. Catching Signals for Graceful Shutdown
- Recipe 82. Writing Logs
- Recipe 83. Using Metrics as Eyes to Production
- Recipe 84. Debugging Running Services
- Final Thoughts
- Index
- - SYMBOLS -
- - A -
- - B -
- - C -
- - D -
- - E -
- - F -
- - G -
- - H -
- - I -
- - J -
- - K -
- - L -
- - M -
- - N -
- - O -
- - P -
- - Q -
- - R -
- - S -
- - T -
- - U -
- - V -
- - W -
- - X -
- - Y -
- - Z -
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.