Index
A
- abstract classes / Object-oriented programming in Go!
- abstract types / Go interfaces
- acyclic graphs / About graphs and nodes
- algorithm complexity / Algorithm complexity
- anonymous functions / Anonymous functions
- Apache / Changing date and time formats
- Apache HTTP server benchmarking tool / Profiling an HTTP server
B
- basic data types, Go
- loops / Go loops
- arrays / Go arrays
- slices / Go slices
- maps / Go maps
- constants / Go constants
- pointers / Go pointers
- BenchmarkFibo() function / A wrong benchmark function
- benchmarking
- about / Benchmarking Go code
- example / A simple benchmarking example
- beta version, Go
- installing / Installing a beta or RC version of Go
- big endian byte order / Reading from /dev/random
- Big O notation / Algorithm complexity
- binary format
- using / Why are we using binary format?
- binary tree
- about / Binary trees in Go
- root of a tree / Binary trees in Go
- depth of a tree / Binary trees in Go
- depth of a node / Binary trees in Go
- leaf / Binary trees in Go
- balanced tree / Binary trees in Go
- unbalanced tree / Binary trees in Go
- implementing, in Go / Implementing a binary tree in Go
- advantages / Advantages of binary trees
- black set / The Tricolor algorithm
- blank identifier / Working with command-line arguments
- buffered channels / Buffered channels, Shared memory and shared variables
- buffered file input and output / Buffered and unbuffered file input and output
- buffered writing
- benchmarking / Benchmarking buffered writing
- bufio package / The bufio package
- build command / Learning more about go build
- byte slice / Byte slices
- bytes package
- using / About the bytes package
C
- * character / Functions that return pointers
- C++ / A quick introduction to Graphviz
- cat(1) utility
- implementing / Implementing the cat(1) utility in Go
- C code
- calling from Go / Calling C code from Go
- calling from Go, same file used / Calling C code from Go using the same file
- calling from Go, separate files used / Calling C code from Go using separate files
- example / The C code
- mixing, with Go code / Mixing Go and C code
- about / The C code
- channel
- about / The Tricolor algorithm, Channels, Go channels revisited
- writing to / Writing to a channel, Reading from a channel
- reading from / Reading from a channel
- unidirectional channel / Channels as function parameters
- as function parameters / Channels as function parameters
- send-only channel / Channels as function parameters
- receive-only channel / Channels as function parameters
- channel of channels
- about / Channel of channels
- using / Channel of channels
- circular list / The container package
- closures / Anonymous functions
- code optimization / About optimization, Optimizing Go code
- code profiling
- about / Profiling Go code
- net/http/pprof standard Go package / The net/http/pprof standard Go package
- simple example / A simple profiling example
- convenient external package / A convenient external package for profiling
- composite types / About composite types
- concurrency / Concurrency and parallelism
- concurrent TCP server
- developing / A concurrent TCP server
- handy concurrent TCP server / A handy concurrent TCP server
- constant generator iota / The constant generator iota
- container package
- about / The container package
- container/heap, using / Using container/heap
- container/list, using / Using container/list
- container/ring, using / Using container/ring
- context package
- about / The context package
- using / The context package
- advanced example / An advanced example of the context package
- Worker pool / Worker pools
- continuation / The Go scheduler revisited
- continuation stealing / The Go scheduler revisited
- copy() function / The copy() function
- CPU profiling / A simple profiling example
- cross-compilation / Cross-compilation
- CSV files
- reading / Reading CSV files
- custom Go package
- developing / Developing your own Go packages
- compiling / Compiling a Go package
- private variables / Private variables and functions
- private functions / Private variables and functions
- init() function / The init() function
- custom interfaces
- developing / Developing your own interfaces
- cyclic graphs / About graphs and nodes
D
- daemon processes / About Unix processes
- data
- loading, on disk / Loading and saving data on disk
- saving, on disk / Loading and saving data on disk
- data race condition / Catching race conditions
- dates
- dealing with / Dealing with times and dates
- working with / Working with dates
- parsing / Parsing dates
- format, changing / Changing date and time formats
- deadlocks / The select keyword
- Debian Linux / The structure of the book
- debug parse tree / Node Trees
- defer keyword / The defer keyword
- deferred functions / The defer keyword
- deserialization / Loading and saving data on disk
- Directed Acyclic Graph / About graphs and nodes
- Directed Graph / About graphs and nodes
- directives / What is a preprocessor?
- directory trees
- traversing / Traversing directory trees
- DNS (Domain Name System) / Performing DNS lookups
- DNS.go utility / Performing DNS lookups
- DNS lookups
- performing / Performing DNS lookups
- NS records of domain, obtaining / Getting the NS records of a domain
- MX records of domain, obtaining / Getting the MX records of a domain
- documentation
- generating / Generating documentation
- DOT / A quick introduction to Graphviz
- doubly linked list
- about / Doubly linked lists in Go
- implementing, in Go / Implementing a doubly linked list in Go
- advantages / Advantages of doubly linked lists
- dtrace tool / The dtrace tool
- Dynamic Programming technique / A concurrent TCP server
E
- eBPF (enhanced Berkeley Packet Filter)
- about / Using eBPF from Go
- reference links / Using eBPF from Go
- using / Using eBPF from Go
- Echo service / A slightly different version of the TCP server
- encapsulation / Private variables and functions
- Erlang programming language / Concurrency and parallelism
- error handling
- about / Error handling in Go, Error handling
- error data type / The error data type
- error output / About error output
- example functions
- creating / Creating example functions
F
- fair scheduling strategy / The Go scheduler revisited
- Fibonacci sequence / A simple benchmarking example
- file
- writing to / Writing to a file
- file permissions / File permissions
- finite automaton / Now for some theory
- flag package
- about / The flag package
- using / The flag package
- fmt.Println() function
- forgetMutex.go
- fork-join concurrency model / The Go scheduler revisited
- for loop / The for loop
- format specifier / About printing output
- functions
- about / About Go functions
- anonymous functions / Anonymous functions
- multiple values, returning / Functions that return multiple values
- return values, naming / The return values of a function can be named!
- with pointer parameters / Functions with pointer parameters
- pointers, returning / Functions that return pointers
- other functions, returning / Functions that return other functions
- other functions as parameters, accepting / Functions that accept other functions as parameters
G
- Garbage Collection
- about / Go advantages, Garbage Collection
- tricolor algorithm / The Tricolor algorithm
- exploring / More about the operation of the Go Garbage Collector
- unsafe code / Unsafe code
- unsafe package / About the unsafe package
- garbage collection safe-point / The Tricolor algorithm
- Go
- concepts / The structure of the book
- about / The history of Go
- history / The history of Go
- URL / The history of Go
- features / Why learn Go?
- advantages / Go advantages
- disadvantages / Is Go perfect?
- error handling / Error handling in Go
- composite types / About composite types
- key value store, developing / Developing a key/value store in Go
- binary trees / Binary trees in Go
- hash tables / Hash tables in Go
- linked list / Linked lists in Go
- doubly linked list / Doubly linked lists in Go
- queues / Queues in Go
- stacks / Stacks in Go
- functions / About Go functions
- object-oriented programming / Object-oriented programming in Go!
- RC version, installing / Installing a beta or RC version of Go
- beta version, installing / Installing a beta or RC version of Go
- web server, creating / Creating a web server in Go
- web client, creating / Creating a web client in Go
- Go arrays
- about / Go arrays
- multi-dimensional arrays / Multi-dimensional arrays
- disadvantages / The shortcomings of Go arrays
- Go assembler / The Go Assembler
- gob format / Loading and saving data on disk
- Go channels
- about / Go channels revisited
- signal channel / Signal channels
- buffered channels / Buffered channels
- nil channels / Nil channels
- channel of channels / Channel of channels
- order of execution, specifying for goroutines / Specifying the order of execution for your goroutines
- Go code
- compiling / Compiling Go code
- executing / Executing Go code
- example / The Go code
- practical advices / General Go coding advices
- testing / Testing Go code
- tests, writing for / Writing tests for existing Go code
- benchmarking / Benchmarking Go code
- simple benchmarking example / A simple benchmarking example
- unreachable Go code, finding / Finding unreachable Go code
- Go code, Go package
- reading / Reading the Go code of a standard Go package
- exploring, of net/url package / Exploring the code of the net/url package
- viewing, of log/syslog package / Looking at the Go code of the log/syslog package
- Go compiler / The Go compiler
- Go constants
- about / Go constants
- constant generator iota / The constant generator iota
- Go documentation server
- godoc utility / The godoc utility
- Go environment / Your Go environment
- Go execution tracer / The go tool trace utility
- Go functions
- calling, from C code / Calling Go functions from C code
- Go garbage collector / The go tool trace utility
- Go interfaces
- about / Go interfaces
- using / Using a Go interface
- switch statement, using / Using switch with interface and data types
- Go loops
- about / Go loops
- for loop / The for loop
- while loop / The while loop
- range keyword / The range keyword
- examples, for loops / Examples of Go for loops
- Go maps
- about / Go maps
- nil map, storing to / Storing to a nil map
- GOMAXPROCS environment variable / The Go scheduler revisited, The GOMAXPROCS environment variable
- Go node / Node Trees
- Go package
- downloading / Downloading Go packages
- about / The Go package, About Go packages
- custom Go package, developing / Developing your own Go packages
- Go code, reading / Reading the Go code of a standard Go package
- rules, for creating / Creating good Go packages
- resources / Additional resources
- Go playground
- Go pointers
- about / Go pointers
- dereferencing / Go pointers
- Go profiler
- web interface / The web interface of the Go profiler
- Go race detector / Catching race conditions
- goroutine
- about / About processes, threads, and goroutines, Goroutines
- creating / Creating a goroutine
- multiple goroutines, creating / Creating multiple goroutines
- waiting to finish / Waiting for your goroutines to finish
- Add() and Done() calls, not agreeing / What if the number of Add() and Done() calls do not agree?
- timing out / Timing out a goroutine, Timing out a goroutine – take 1, Timing out a goroutine – take 2
- Go rules
- about / Two Go rules
- Go package, using / You either use a Go package or do not include it
- curly braces, formatting / There is only one way to format curly braces
- Go scheduler / The Go scheduler, The Go scheduler revisited
- Go slices
- about / Go slices
- operations, performing on / Performing basic operations on slices
- capacity / Slices are being expanded automatically
- expanding automatically / Slices are being expanded automatically
- length / Slices are being expanded automatically
- byte slices / Byte slices
- copy() function / The copy() function
- multi-dimensional slices / Multidimensional slices
- example / Another example of slices
- sorting, with sort.slice() / Sorting slices using sort.slice()
- go tool trace utility
- about / The go tool trace utility
- using / The go tool trace utility
- Go version 1.10
- about / The Go version used in this chapter
- versus, Go version 1.9 / Comparing Go version 1.10 with Go version 1.9
- changes / Comparing Go version 1.10 with Go version 1.9
- grammar / Now for some theory
- graphs
- about / About graphs and nodes
- cyclic graphs / About graphs and nodes
- acyclic graphs / About graphs and nodes
- Graphviz / A quick introduction to Graphviz
- gray set / The Tricolor algorithm
- group ID
- finding / User ID and group ID
- gRPC / Additional resources
H
- handler function / Creating a web server in Go
- hash table
- about / Go maps, Hash tables in Go
- implementing, in Go / Implementing a hash table in Go
- lookup functionality, implementing / Implementing the lookup functionality
- advantages / Advantages of hash tables
- HTML output
- constructing / Constructing HTML output
- HTML template / Text and HTML templates
- http.Request type / The http.Request type
- http.Response structure / The http.Response type
- http.RoundTripper / About net/http, net, and http.RoundTripper
- http.Transport type / The http.Transport type
- HTTP connections
- timing out / Timing out HTTP connections
- timeout period on server side, setting / Setting the timeout period on the server side
- timeout, from client side / Yet another way to time out!
- HTTP handlers
- testing / Testing HTTP handlers
- HTTP tracing / HTTP tracing
- Hugo utility / Additional resources
I
- inheritance / Object-oriented programming in Go!
- init() function / The init() function
- io.Reader interface / The io.Reader and io.Writer interfaces
- io.Writer interface / The io.Reader and io.Writer interfaces
- IP (Internet Protocol) / About TCP/IP
- IPv4 / About IPv4 and IPv6
- IPv6 / About IPv4 and IPv6
J
- Java / More about the operation of the Go Garbage Collector
- JSON format / Loading and saving data on disk
K
- kernel processes / About Unix processes
- key value store
- developing / Developing a key/value store in Go
L
- Last In First Out (LIFO) / The defer keyword
- latency / More about the operation of the Go Garbage Collector
- linked list
- about / Linked lists in Go
- node, removing from / Linked lists in Go
- implementing, in Go / Implementing a linked list in Go
- advantages / Advantages of linked lists
- little endian byte order / Reading from /dev/random
- log.Fatal() / About log.Fatal()
- log.Panic() / About log.Panic()
- log/syslog package
- code, viewing / Looking at the Go code of the log/syslog package
- log files, writing to
- about / Writing to log files
- logging levels / Logging levels
- log servers / Log servers
- information sending / A Go program that sends information to log files
- logging facility / Logging facilities
- logging level / Logging levels
- logical processors / The Go scheduler revisited
- log levels, writing to
- logging facilities / Logging facilities
- low-level network programming
- performing / Doing low-level network programming
- raw ICMP network data, grabbing / Grabbing raw ICMP network data
M
- macOS High Sierra / The structure of the book
- map key / Go maps
- mark-and-sweep algorithm / More about the operation of the Go Garbage Collector
- memory profiling / A simple profiling example
- method overriding / Object-oriented programming in Go!
- modulo operator / Implementing a hash table in Go
- monitor goroutine / Sharing memory using goroutines
- multi-dimensional arrays / Multi-dimensional arrays
- multi-dimensional slices / Multidimensional slices
- mutator / The Tricolor algorithm
- mutual exclusion variable / Shared memory and shared variables
- MX records of domain / Getting the MX records of a domain
N
- name servers, domain / Getting the NS records of a domain
- nc(1) command-line utility / The nc(1) command-line utility
- net/http package / About net/http, net, and http.RoundTripper
- net/url package
- code, exploring / Exploring the code of the net/url package
- netCapabilities.go utility / Reading the configuration of network interfaces
- netConfig.go utility / Reading the configuration of network interfaces
- net package / About net/http, net, and http.RoundTripper
- net standard Go package / The net standard Go package
- network interfaces
- configuration, reading / Reading the configuration of network interfaces
- new keyword
- using / Using the new keyword
- Nginx / Changing date and time formats
- nil channels
- about / Nil channels
- using / Nil channels
- nodes / About graphs and nodes
- node trees / Node Trees
O
- = operator / About := and =
- object-oriented programming (OOP) / Is Go perfect?
- object file / The Go compiler
- online references / Additional resources
- output
- printing / About printing output
P
- panic() function
- about / Panic and Recover
- using / Using the panic function on its own
- parallelism / Concurrency and parallelism
- pattern matching
- about / Regular expressions and pattern matching, Now for some theory
- simple example / A simple example
- example / A simple example
- advanced example / A more advanced example
- Perl / A quick introduction to Graphviz
- Pi
- calculating, with accuracy / Calculating Pi with great accuracy
- pipeline / Pipelines
- pragmas / What is a preprocessor?
- preprocessor / Go advantages, What is a preprocessor?
- private functions / Private variables and functions
- private variables / Private variables and functions
- process / About Unix processes, About processes, threads, and goroutines
- process ID / About Unix processes, About syscall.PtraceRegs
- program / About Unix processes
- programming languages
- C / The history of Go
- Pascal / The history of Go
- Alef / The history of Go
- Oberon / The history of Go
- ptraceRegs.go utility / About syscall.PtraceRegs
- Python / A quick introduction to Graphviz
Q
- queues
- about / Queues in Go
- implementing, in Go / Implementing a queue in Go
R
- race conditions
- catching / Catching race conditions
- random numbers
- generating / Generating random numbers
- random strings, generating / Generating random strings
- range keyword / The range keyword
- re-slicing / Performing basic operations on slices
- read-only channel / Channels as function parameters
- receive-only channel / Channels as function parameters
- recognizer / Now for some theory
- recover() function / Panic and Recover
- reflection
- about / Reflection
- simple reflection example / A simple Reflection example
- advanced example / A more advanced reflection example
- advantages / The three disadvantages of reflection
- disadvantages / The three disadvantages of reflection
- object-oriented programming / Object-oriented programming in Go!
- regular expressions (regexp)
- about / Regular expressions and pattern matching, Now for some theory
- simple example / A simple example
- advanced example / A more advanced example
- IPv4 addresses, matching / Matching IPv4 addresses
- Release Candidate (RC) version, Go
- installing / Installing a beta or RC version of Go
- Remote Procedure Call (RPC) / Remote Procedure Call (RPC)
- RFC850 format / Changing date and time formats
- RPC client / The RPC client
- RPC server / The RPC server
- Ruby / A quick introduction to Graphviz
S
- scheduler / The Go scheduler revisited
- select keyword
- about / The select keyword
- using / The select keyword
- semaphores / Buffered channels
- send-only channel / Channels as function parameters
- serialization / Loading and saving data on disk
- SetDeadline() function / More information about SetDeadline
- shared memory
- about / Shared memory and shared variables
- using goroutines / Sharing memory using goroutines
- shared variables / Shared memory and shared variables
- short assignment statement / About := and =
- SIGINT signal / Handling Unix signals
- signal channel
- about / Signal channels
- using / Channel of channels
- slice literals / Performing basic operations on slices
- sort.Slice() function
- SQLite3
- commands / Basic SQLite3 commands
- stacks
- about / Stacks in Go
- implementing, in Go / Implementing a stack in Go
- stalling join / The Go scheduler revisited
- standard output
- about / Using standard output
- using / Using standard output
- static linking / Go advantages
- stop-the-world garbage collector / More about the operation of the Go Garbage Collector
- strace tool / The strace tool
- stream encoding / Loading and saving data on disk
- strings
- about / Strings
- rune / What is a rune?
- Unicode package / The Unicode package
- strings standard Go package / The strings package
- strings package
- using / The strings package revisited
- structure literal / Structures
- structures
- about / Structures
- pointers / Pointers to structures
- new keyword, using / Using the new keyword
- switch statement / The switch statement
- sync.Mutex type / The sync.Mutex type
- sync.RWMutex type
- about / The sync.RWMutex type
- using / The sync.RWMutex type
- syscall.PtraceRegs / About syscall.PtraceRegs
- syscall package
- about / The syscall package
- fmt.Println() function / Finding out how fmt.Println() really works
- using / Tracing system calls
- system calls
- about / The syscall package
- tracing / Tracing system calls
T
- task / The Go scheduler revisited
- TCP (Transmission Control Protocol) / About TCP/IP
- TCP/IP / About TCP/IP
- TCP client
- about / A TCP client
- source port / A TCP client
- destination port / A TCP client
- different version / A slightly different version of the TCP client
- TCP packets / About TCP/IP
- TCP server
- about / A TCP server
- different version / A slightly different version of the TCP server
- templates / Text and HTML templates
- text files
- reading / Reading text files
- reading, line by line / Reading a text file line by line
- reading, word by word / Reading a text file word by word
- reading, character by character / Reading a text file character by character
- reading, from /dev/random / Reading from /dev/random
- exact amount of data, reading / Reading the amount of data you want from a file
- text output
- generating / Generating text output
- text template / Text and HTML templates
- thread / About processes, threads, and goroutines
- times
- dealing with / Dealing with times and dates
- working with / Working with times
- parsing / Parsing times
- format, changing / Changing date and time formats
- traceSyscall.go utility
- using / Tracing system calls
- tricolor algorithm / The Tricolor algorithm
- tricolor mark-and-sweep algorithm / The Tricolor algorithm
- tshark / Wireshark and tshark tools
- tuples / Tuples
- type assertion / About type assertion
- type methods / Type methods
U
- UDP (User Datagram Protocol) / About TCP/IP
- UDP client
- developing / A UDP client
- UDP server
- developing / Developing a UDP server
- unbuffered file input and output / Buffered and unbuffered file input and output
- Unicode / Go advantages
- unidirectional channels / Channels as function parameters
- Unix
- stdin / Unix stdin, stdout, and stderr
- stdout / Unix stdin, stdout, and stderr
- stderr / Unix stdin, stdout, and stderr
- Unix epoch time / Dealing with times and dates
- Unix operating system / The structure of the book
- Unix pipes
- programming / Programming Unix pipes in Go
- Unix processes / About Unix processes
- Unix signals
- handling / Handling Unix signals
- two signals, handling / Handling two signals
- all signals, handling / Handling all signals
- Unix standard error / About error output
- Unix utilities
- about / Two handy Unix utilities
- strace tool / The strace tool
- dtrace tool / The dtrace tool
- unsafe code / Unsafe code
- unsafe package
- about / About the unsafe package
- example / Another example of the unsafe package
- user ID
- finding / User ID and group ID
- user input
- acquiring / Getting user input
- standard input, reading from / Reading from standard input
- command line arguments, working with / Working with command-line arguments
- user processes / About Unix processes
W
- web client, in Go
- creating / Creating a web client in Go
- making advanced / Making your Go web client more advanced
- web interface, Go profiler
- about / The web interface of the Go profiler
- profiling example / A profiling example that uses the web interface
- web server
- creating / Creating a web server in Go
- HTTP server, profiling / Profiling an HTTP server
- website, Go
- creating / Creating a website in Go
- WebSocket / Additional resources
- while loop / The while loop
- white set / The Tricolor algorithm
- Wireshark / Wireshark and tshark tools
- Worker pools
- about / Worker pools
- implementing / Worker pools
- work stealing strategy / The Go scheduler revisited
- write-only channel / Channels as function parameters
- write barrier / The Tricolor algorithm
X
- XML format / Loading and saving data on disk