1 option
Go standard library cookbook : over 120 specific ways to make full use of the standard library components in Golang / Radomír Sohlich.
- Format:
- Book
- Author/Creator:
- Sohlich, Radomír, author.
- Language:
- English
- Subjects (All):
- Go (Computer program language).
- Physical Description:
- 1 online resource (311 pages)
- Edition:
- 1st ed.
- Place of Publication:
- Birmingham, [England] ; Mumbai, [India] : Packt, 2018.
- Biography/History:
- Sohlich Radomir: Radomir Sohlich received the master's degree in Applied Informatics from Faculty of Applied Informatics at Tomas Bata University in Zlin. After that, he got a job in a start-up company as a software developer and worked on various projects, usually based on the Java platform. Currently, he continues a software developer career as a contractor for a large international company. In 2015, he fell in love with Go and kept exploring the endless power and possibilities of the language. He is passionate about learning new approaches and technology and feels the same about sharing the knowledge with others.
- Summary:
- Google's Golang is the next talk of the town, with amazing features and a powerful library. This book will gear you up by taking you through recipes that will teach you how to leverage the standard library to implement a particular solution. This will enable Go developers to take advantage of using a rock-solid standard library instead of.
- Contents:
- Cover
- Title Page
- Copyright and Credits
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: Interacting with the Environment
- Introduction
- Retrieving the Golang version
- Getting ready
- How to do it...
- How it works...
- Accessing program arguments
- There's more…
- Creating a program interface with the flag package
- How it works…
- Getting and setting environment variables with default values
- How to do it…
- Retrieving the current working directory
- Getting the current process PID
- Handling operating system signals
- Calling an external process
- See also
- Retrieving child process information
- Reading/writing from the child process
- Shutting down the application gracefully
- File configuration with functional options
- Chapter 2: Strings and Things
- Finding the substring in a string
- Breaking the string into words
- There's more...
- Joining the string slice with a separator
- Concatenating a string with writer
- Aligning text with tabwriter
- Replacing part of the string
- Finding the substring in text by the regex pattern.
- How to do it...
- Decoding a string from the non-Unicode charset
- Controlling case
- Parsing comma-separated data
- Managing whitespace in a string
- Indenting a text document
- Chapter 3: Dealing with Numbers
- Converting strings to numbers
- Comparing floating-point numbers
- Rounding floating-point numbers
- Floating-point arithmetics
- Formatting numbers
- Converting between binary, octal, decimal, and hexadecimal
- Formatting with the correct plurals
- Generating random numbers
- Operating complex numbers
- Converting between degrees and radians
- Taking logarithms
- Generating checksums
- Chapter 4: Once Upon a Time
- Finding today's date
- Formatting date to string
- Parsing the string into date
- Converting dates to epoch and vice versa
- Retrieving time units from the date
- Date arithmetics.
- Finding the difference between two dates
- Converting between time zones
- Running the code block periodically
- Waiting a certain amount of time
- Timeout long-running operations
- Serializing the time and date
- Chapter 5: In and Out
- Reading standard input
- Writing standard output and error
- Opening a file by name
- Reading the file into a string
- Reading/writing a different charset
- Seeking a position within a file
- Reading and writing binary data
- Writing to multiple writers at once
- Piping between writer and reader
- Serializing objects to binary format
- Reading and writing ZIP files
- Parsing a large XML file effectively
- Extracting data from an incomplete JSON array
- Chapter 6: Discovering the Filesystem
- Getting file information
- Creating temporary files
- Writing the file
- Writing the file from multiple goroutines
- Listing a directory.
- Changing file permissions
- Creating files and directories
- Filtering file listings
- Comparing two files
- Resolving the user home directory
- Chapter 7: Connecting the Network
- Resolving local IP addresses
- Connecting to the remote server
- Resolving the domain by IP address and vice versa
- Connecting to the HTTP server
- Parsing and building a URL
- Creating an HTTP request
- Reading and writing HTTP headers
- Handling HTTP redirects
- Consuming the RESTful API
- Sending a simple email
- Calling the JSON-RPC service
- Chapter 8: Working with Databases
- Connecting the database
- Validating the connection
- Executing statements
- Operations with prepared statements
- Canceling the pending query
- Reading query result metadata
- Retrieving data from a query result
- Getting ready.
- Parsing the query result into a map
- Handling transactions
- Executing stored procedures and functions
- Chapter 9: Come to the Server Side
- Creating the TCP server
- Creating the UDP server
- Handling multiple clients
- Creating the HTTP Server
- Handling HTTP requests
- Creating HTTP middleware layer
- Serving static files
- Serving content generated with templates
- Handling redirects
- Handling cookies
- Gracefully shutdown the HTTP server
- Serving secured HTTP content
- Resolving form variables
- Chapter 10: Fun with Concurrency
- Synchronizing access to a resource with Mutex
- Creating map for concurrent access
- Running a code block only once
- Pooling resources across multiple goroutines
- Synchronizing goroutines with WaitGroup
- Getting the fastest result from multiple sources
- Propagating errors with errgroup
- How it works.
- Chapter 11: Tips and Tricks.
- Notes:
- Includes index.
- Description based on online resource; title from PDF title page (EBC, viewed March 22, 2018).
- ISBN:
- 9781788391672
- 1788391675
- OCLC:
- 1463579265
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.