What you will learn in Go in Action, Second Edition
Chapter by chapter
Chapter 1: Go is the solution
The introduction previews the problems Go was designed to solve and the design choices the chapter will explain.
What you learn in chapter 1 →Chapter 2: Diving into Go
The chapter introduces a hands-on Go project that uses a real-world-style utility to teach language fundamentals and introduce Go’s tooling.
What you learn in chapter 2 →Chapter 3: Primitive types and operators
The chapter introduces Go’s built-in types as fundamental building blocks and previews the types and operations it will cover.
What you learn in chapter 3 →Chapter 4: Collection types
Introduces Go’s built-in collection types and the kinds of data each is suited to holding.
What you learn in chapter 4 →Chapter 5: Working with types
This chapter introduction explains why Go’s type system helps model real-world domains safely and previews the type features used in a recipe application.
What you learn in chapter 5 →Chapter 6: Generics
Introduces Go generics as a type-safe layer of abstraction and previews the chapter’s progression from type parameters to reusable collections and standard-library utilities.
What you learn in chapter 6 →Chapter 7: Errors in Go
The introduction explains why software must handle unexpected conditions and previews Go’s explicit, flexible approach to errors through a small key/value database example.
What you learn in chapter 7 →Chapter 8: Testing and tooling
This chapter introduction presents Go testing as more than a way to check finished code: tests can guide development, reveal performance problems, and find bugs in unexpected inputs.
What you learn in chapter 8 →Chapter 9: Concurrency
The chapter introduces the difference between concurrency and parallelism, explains why concurrency helps applications stay responsive, and previews Go’s tools for concurrent work.
What you learn in chapter 9 →Chapter 10: The standard library
The introduction presents Go’s standard library and previews a chapter-long JSON and XML utility built by combining its packages.
What you learn in chapter 10 →Chapter 11: Working with larger projects
The chapter introduces Go’s packages, modules, versions, and workspaces as tools for turning a small RSS application into an organized multimodule project.
What you learn in chapter 11 →Concepts explained in this book
- genericsGeneric programming is a language feature that defines functions, types, and interfaces parameterized over types while preserving compile-time type safety.
- concurrencyConcurrent programming is the design of software whose multiple execution activities can make progress during overlapping periods of time.
- GoGo is an open-source, statically typed programming language designed for efficient compilation, execution, concurrency, and software development tooling.
- channelA channel is a typed Go synchronization mechanism that transfers values between goroutines without requiring shared-memory access.
- goroutineA lightweight Go execution unit that runs a function concurrently with the rest of a program.
- type constraintA type constraint restricts the types that may be substituted for a type parameter and specifies operations guaranteed to be valid for those types.
- go testgo test -cover is the Go test command mode that runs package tests and reports the percentage of statements they execute.
- slicingA slice expression is Go syntax that creates a slice view over an index range of an array or slice while sharing the underlying storage.
- MapA map is a Go associative data structure that associates keys with values.
- module pathA module path is the identifier that names a Go module and distinguishes it when resolving versions and imports.
- makemake is a Go built-in function that allocates and initializes slices, maps, or channels with a specified type and size parameters.
- user-defined typeA defined type is a programmer-declared type that creates a distinct named type with an underlying type and can have its own methods.
- go moduleA Go module is a versioned collection of Go packages described by a go.mod file and managed as a unit for dependency resolution and builds.
- comparablecomparable is a predeclared Go interface constraint satisfied by types whose values support equality and inequality comparisons.
- interfaceAn interface is a contract specifying operations or type-set membership that a type can provide without defining the type's implementation.
- arrayAn array is a fixed-length, indexed sequence of values of one element type that is itself a value in Go.
- communicating sequential processCommunicating sequential processes is a formal model of concurrent computation in which independently executing processes communicate through message-passing channels.
- go.mod fileA go.mod file is a Go module definition file that records the module path, Go language version, and module dependencies.
- buffered channelA buffered channel is a channel with storage for a specified number of values that can be sent before a send operation blocks.
- select statementA select statement is a Go control construct that waits for and proceeds with a communication operation that is ready among multiple channel operations.
- integerAn integer type represents whole-number values without a fractional component.
- versionA version number is an identifier representing a particular software release or state, often communicating its compatibility or maturity.
- io.Readerio.Reader is the Go interface for reading a stream of bytes into a supplied buffer.
- packageA package is a Go compilation and namespace unit that groups related declarations and controls their visibility across source files.
- structThe struct keyword introduces a Go struct type declaration.
- unbuffered channelAn unbuffered channel is a channel with no storage capacity in which sending and receiving synchronize directly.
- linked listA linked list is a sequence data structure whose elements are stored in nodes connected by links and whose element type can be parameterized in its generic form.
- type systemA type system is the set of rules governing the classification of values and the validity of operations on them.
- semantic versioningSemantic versioning is a versioning convention in which changes to major, minor, and patch components communicate compatibility and release significance.
- pointerA pointer type is a Go type whose values identify the memory locations of values of a specified target type.
- endpointAn HTTP endpoint is a network-accessible interface identified by an HTTP method and resource location that handles client requests.
- unsigned integerAn unsigned integer is an integer type that represents nonnegative whole-number values only.
- os packageThe os package is a Go standard-library package that provides platform-independent interfaces for operating-system functionality, including files, processes, and environment variables.
- panicA panic is Go's runtime mechanism for terminating ordinary execution and reporting an unrecoverable run-time error unless recovered.
- len()len is a Go built-in function that returns the number of bytes in a string or the number of elements in a supported collection.
- ioio is the Go standard-library package that defines interfaces and utilities for input and output operations.
- type safetyType safety is the property that prevents operations from applying values in ways inconsistent with their types.
- cmd directory patternThe cmd directory pattern organizes independently executable Go programs into separate subdirectories within a module.
- go workspaceA Go workspace is a development-time configuration that coordinates multiple Go modules so they can be developed and tested together without publishing versions.
- synchronizationSynchronization is the coordination of concurrent computations to control their interactions and access to shared state.
- error typeAn error type is Go's interface type for representing failed or abnormal operation results through an Error method.
- capacitySlice capacity is the maximum number of elements a Go slice can contain by extending from its first element within its underlying storage.
- error valueAn error value is a Go value of the error type that reports whether an operation encountered a problem.
- backing arrayA backing array is the underlying contiguous storage that holds the elements accessible through a slice and any reserved capacity.
- range loopA range loop is a Go for-loop form that iterates over the elements or entries of a supported collection and can provide each element's index and value.
- go.sumgo.sum is a Go module file containing cryptographic checksums for downloaded module dependencies.
- generic interfaceA generic interface is an interface parameterized by one or more type parameters whose implementations must match the resulting type-specific contract.
- struct tagA struct tag is metadata attached to a Go struct field that can guide reflection-based processing such as serialization and field mapping.
- entry pointThe main function is the specially named Go function that serves as the starting point of an executable program.
- go docgo doc is the standard Go command that extracts and presents documentation from Go source code.
- WaitGroupWaitGroup is a Go synchronization type that counts active operations and blocks until its counter reaches zero.
- hexagonal architecturePorts and Adapters is an architectural pattern that isolates core application logic behind interfaces and connects those interfaces to external implementations.
- deserializationUnmarshaling is the process of reconstructing an in-memory value from a serialized representation.
- encoding/jsonencoding/json is Go's standard-library package for encoding Go values as JSON and decoding JSON into Go values.
- serializationMarshaling is the process of converting an in-memory value into a serialized representation.
- go keywordThe Go language keyword that starts a function executing as a goroutine.
- type aliasA type alias gives an existing type an alternate name without creating a distinct type.
- test-driven developmentA test-driven workflow is a development process that begins with failing automated tests and incrementally implements code until the tests pass.
- type assertionA type assertion is a Go operation that checks whether an interface value contains a specified concrete type and retrieves the contained value if it does.
- thread poolA thread pool is a managed collection of reusable worker threads that execute submitted tasks.
- io.Writerio.Writer is the Go interface for writing byte data to a destination.
- fmtThe fmt package is a Go standard-library package that provides formatted input and output operations.
- Liskov Substitution PrincipleThe Liskov substitution principle states that objects of a subtype should be usable wherever objects of its supertype are expected without invalidating program correctness.
- failureAn error is a value or condition indicating that an operation failed or cannot produce its intended result.
- contextA Go context is a request-scoped value carrying cancellation, deadlines, and other propagation metadata across call boundaries.
- adapterThe adapter pattern presents an existing component through an interface compatible with the surrounding application's expectations.
- appendappend is a Go built-in function that adds elements to a slice and returns a slice representing the resulting sequence.
- bit operationA bitwise operation computes a result by manipulating the individual binary bits of integer operands.
- bufiobufio is Go's standard library package for buffered input and output, including scanner-based tokenization.
- blockingA blocking I/O operation prevents the calling execution flow from progressing until input or output completes.
- concurrency modelA concurrency model is the set of language abstractions and rules governing the execution and coordination of multiple computations.
- parallelismParallelism is the simultaneous execution of multiple computational activities, typically on separate processors or cores.
- bufio.Scannerbufio.Scanner is a Go type that incrementally reads input and returns successive tokens according to a configured split function.
- fan-out/fan-in patternFan-out/fan-in is a concurrency pattern that distributes work across concurrent executions and then combines their results.
- json.Marshaljson.Marshal is a Go standard-library function that encodes a Go value as a JSON-formatted byte sequence.
- json.Unmarshaljson.Unmarshal is a Go standard-library function that decodes JSON data into a supplied Go value.
- test doubleA test double is a substitute component that provides controlled behavior or data in place of a real dependency during testing.
- benchmarkBenchmark testing measures how code performs under repeated execution with controlled inputs and conditions.
- bufferingBuffering is the technique of temporarily accumulating input or output data in memory to reduce the cost of individual transfers.
- breaking changeA breaking change is a modification that can prevent existing consumers from continuing to work without updates.
- stringA string is Go's immutable sequence-of-bytes type, conventionally used to hold encoded text.
- go mod initgo mod init is a Go command that creates a go.mod file and initializes a module in a project directory.
- fuzzingFuzzing automatically tests software with generated or mutated inputs to find failures and unexpected behavior.
- polymorphismPolymorphism is the ability to treat values of different concrete types through a shared interface or abstraction.
- int64int64 is Go's signed integer type that represents values using exactly 64 bits.
- integer wraparoundInteger wraparound is the behavior in which arithmetic outside an integer type's representable range produces a value obtained by cycling through its fixed-width bit representation.
- ingredientIngredient is a recipe-domain type representing the name of an ingredient as a distinct named value.
- runeA rune is Go's alias for int32 that represents a Unicode code point independently of its encoded representation.
- MarshalJSONMarshalJSON is a method convention that customizes how a Go value is encoded as JSON.
- UnmarshalJSONUnmarshalJSON is a method convention that customizes how JSON data is decoded into a Go value.
- sentinel errorA sentinel error is a predefined error value identified by comparison so callers can make programmatic decisions about a failure condition.
- loopA for loop is a Go control-flow construct that repeatedly executes a block according to optional initialization and post clauses and a loop condition or range clause.
- listA list is an ordered collection of elements that supports sequential access and typically dynamic size.
- ReadCloserReadCloser is a Go interface combining the ability to read data with the ability to close a resource.
- domain modelA domain model is a representation of the concepts and relationships in a problem domain that software components conform to.
- domain-driven designDomain-Driven Design is a software design approach that structures software around real-world business concepts and domain behavior.
- command-line argumentA command-line argument is a value supplied to a program when it is invoked from a command line or operating-system process launcher.
- gofmtgofmt is the standard Go source-code formatter that applies the official Go formatting style.
- value copyCopy by value is an assignment behavior in which a variable receives an independent copy of another value's data.
- validationValidation is the process of checking that input data satisfies required structural, type, and semantic constraints.
- format verbA format verb is a formatting directive that specifies how a value is converted to text in formatted output.
- dependency injectionDependency injection is a design technique in which a component receives its required collaborators from outside rather than constructing them internally.
- HTTP layerAn HTTP layer is the application layer responsible for receiving HTTP requests, invoking application behavior, and producing HTTP responses.
- tokenA token is a piece of input data produced by a scanner according to its splitting rules.
- build timeCompilation speed is the time or rate required to transform source code into executable or intermediate output.
- encoding/xmlencoding/xml is a Go standard-library package for encoding and decoding XML documents.
- nodeA node is a data-structure element that stores a value and links to neighboring elements in a linked list.
- checksumA cryptographic checksum is a digest computed from data that can reveal whether the data has changed.
- dependency managementDependency management is the process of declaring, resolving, versioning, and obtaining software components required by a project.
- go mod tidygo mod tidy is a Go command that synchronizes module dependencies and their checksums with the packages imported by a project.
- reproducible buildA reproducible build is a build process that produces the same result from the same source and dependency inputs.
- lockingA lock is a synchronization mechanism that restricts concurrent access to a protected resource.
- table-driven testA table-driven test represents multiple test cases as data records and runs a common test procedure over them.
- StringerStringer is a Go interface conventionally satisfied by a type that provides a String method for custom textual formatting.
- structural typingStructural typing determines interface compatibility from the methods a type provides rather than from an explicit declaration of implementation.
- value receiverA value receiver is a method receiver that operates on a copied value of its receiver type rather than on a pointer to that value.
- main packageThe main package is the special Go package whose compiled program is intended to be an independently runnable executable.
- workerA worker service is a background process that performs scheduled or queued processing independently of request-serving services.
- strconvstrconv is a Go standard-library package for converting between strings and basic data types such as integers, floating-point numbers, and booleans.
- code coverageCode coverage is a measurement of which portions or execution paths of a program are exercised by tests.
- compile-time interface checkA compile-time interface check is a declaration or construct that makes the compiler verify that a type satisfies a specified interface.
- producer-consumerA producer-consumer pattern separates components that generate data from components that consume it, allowing them to operate independently.
- Go compilerThe Go compiler is the program that checks Go source code and translates it into executable machine code or an intermediate representation.
- regexp packageThe regexp package is Go's standard-library package for compiling and matching regular expressions.
- fmt.Printlnfmt.Println is a Go standard-library function that prints its arguments with spaces between them and a trailing newline.
- go rungo run is the standard Go command that compiles and executes a Go program in one operation.
- type switchA type switch is a Go control-flow construct that selects a case according to the dynamic type of an interface value.
- data typeA type is a specification of the values and operations permitted for a piece of data in a programming language.
- HTTP multiplexerAn HTTP multiplexer is a routing component that selects handlers for requests according to their paths.
- httptesthttptest is a Go standard-library package that provides utilities for testing HTTP servers and handlers.
- httptest.ResponseRecorderhttptest.ResponseRecorder is a Go test utility that records an HTTP handler's response for inspection.
- test serverA test server is a temporary server instance created to exercise server behavior under controlled test conditions.
- errors.Aserrors.As is a Go standard-library function that finds an error in an error chain assignable to a specified type and stores it in a destination value.
- methodA method is a function associated with a type that defines behavior operating on values of that type.
- byte typeA byte is an eight-bit unsigned integer value used in Go to represent raw binary data.
- entityAn entity is a domain object representing a distinct business concept with identity and associated data or behavior.
- task cancellationA cancellation signal is an indication that ongoing work should stop because it is no longer needed.
- flag packageThe flag package is a Go standard-library package for defining, parsing, and retrieving command-line options and positional arguments.
- test functionA test function is a Go function recognized by the testing tool as an executable test according to its required naming and signature convention.
- fmt.Fprintffmt.Fprintf is a Go standard-library function that formats text according to a format string and writes it to an io.Writer.
- io.Copyio.Copy transfers data from a Reader to a Writer until the input reaches end of file or an error occurs.
- struct embeddingStruct embedding is a Go language feature that embeds one struct type in another and promotes the embedded type's fields and methods.
- SplitFuncSplitFunc is the function type used by bufio.Scanner to define how input is divided into tokens.
- zero valueA zero value is the default value assigned to a newly declared Go variable when no explicit initial value is provided.
- circular dependencyA circular dependency is a dependency cycle in which packages or modules depend on one another directly or through an intermediate chain.
- composition over inheritanceComposition over inheritance is a design pattern that builds complex types by combining simpler components instead of deriving them from superclasses.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
