更新时间:2021-06-24 18:57:31
coverpage
Title Page
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Get in touch
Reviews
Interacting with the Environment
Introduction
Retrieving the Golang version
How to do it...
How it works...
Accessing program arguments
Creating a program interface with the flag package
Getting and setting environment variables with default values
Retrieving the current working directory
Getting the current process PID
Handling operating system signals
Calling an external process
Retrieving child process information
Reading/writing from the child process
Shutting down the application gracefully
File configuration with functional options
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
Decoding a string from the non-Unicode charset