src/

directory
v0.0.0-...-66e828a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2019 License: MIT

Directories

Path Synopsis
chapter1
channels command
chapter10
listing01 command
Sample program demonstrating struct composition.
Sample program demonstrating struct composition.
listing02 command
Sample program demonstrating decoupling with interfaces.
Sample program demonstrating decoupling with interfaces.
listing03 command
Sample program demonstrating interface composition.
Sample program demonstrating interface composition.
listing04 command
Sample program demonstrating decoupling with interface composition.
Sample program demonstrating decoupling with interface composition.
listing05 command
Sample program demonstrating when implicit interface conversions are provided by the compiler.
Sample program demonstrating when implicit interface conversions are provided by the compiler.
listing06 command
Sample program to show how you can personally mock concrete types when you need to for your own packages or tests.
Sample program to show how you can personally mock concrete types when you need to for your own packages or tests.
listing06/pubsub
Package pubsub simulates a package that provides publication/subscription type services.
Package pubsub simulates a package that provides publication/subscription type services.
chapter2
sample command
chapter3
dbdriver command
Sample program to show how to show you how to briefly work with the sql package.
Sample program to show how to show you how to briefly work with the sql package.
wordcount command
Sample program to show how to show you how to briefly work with io.
Sample program to show how to show you how to briefly work with io.
words
Package words provides support for counting words.
Package words provides support for counting words.
chapter5
listing11 command
Sample program to show how to declare methods and how the Go compiler supports them.
Sample program to show how to declare methods and how the Go compiler supports them.
listing34 command
Sample program to show how to write a simple version of curl using the io.Reader and io.Writer interface support.
Sample program to show how to write a simple version of curl using the io.Reader and io.Writer interface support.
listing35 command
Sample program to show how a bytes.Buffer can also be used with the io.Copy function.
Sample program to show how a bytes.Buffer can also be used with the io.Copy function.
listing36 command
Sample program to show how to use an interface in Go.
Sample program to show how to use an interface in Go.
listing46 command
Sample program to show how you can't always get the address of a value.
Sample program to show how you can't always get the address of a value.
listing48 command
Sample program to show how polymorphic behavior with interfaces.
Sample program to show how polymorphic behavior with interfaces.
listing50 command
Sample program to show how to embed a type into another type and the relationship between the inner and outer type.
Sample program to show how to embed a type into another type and the relationship between the inner and outer type.
listing56 command
Sample program to show how embedded types work with interfaces.
Sample program to show how embedded types work with interfaces.
listing60 command
Sample program to show what happens when the outer and inner type implement the same interface.
Sample program to show what happens when the outer and inner type implement the same interface.
listing64 command
Sample program to show how the program can't access an unexported identifier from another package.
Sample program to show how the program can't access an unexported identifier from another package.
listing64/counters
Package counters provides alert counter support.
Package counters provides alert counter support.
listing68 command
Sample program to show how the program can access a value of an unexported identifier from another package.
Sample program to show how the program can access a value of an unexported identifier from another package.
listing68/counters
Package counters provides alert counter support.
Package counters provides alert counter support.
listing71 command
Sample program to show how unexported fields from an exported struct type can't be accessed directly.
Sample program to show how unexported fields from an exported struct type can't be accessed directly.
listing71/entities
Package entities contains support for types of people in the system.
Package entities contains support for types of people in the system.
listing74 command
Sample program to show how unexported fields from an exported struct type can't be accessed directly.
Sample program to show how unexported fields from an exported struct type can't be accessed directly.
listing74/entities
Package entities contains support for types of people in the system.
Package entities contains support for types of people in the system.
chapter6
listing01 command
This sample program demonstrates how to create goroutines and how the scheduler behaves.
This sample program demonstrates how to create goroutines and how the scheduler behaves.
listing04 command
This sample program demonstrates how the goroutine scheduler will time slice goroutines on a single thread.
This sample program demonstrates how the goroutine scheduler will time slice goroutines on a single thread.
listing07 command
This sample program demonstrates how to create goroutines and how the goroutine scheduler behaves with two logical processor.
This sample program demonstrates how to create goroutines and how the goroutine scheduler behaves with two logical processor.
listing09 command
This sample program demonstrates how to create race conditions in our programs.
This sample program demonstrates how to create race conditions in our programs.
listing13 command
This sample program demonstrates how to use the atomic package to provide safe access to numeric types.
This sample program demonstrates how to use the atomic package to provide safe access to numeric types.
listing15 command
This sample program demonstrates how to use the atomic package functions Store and Load to provide safe access to numeric types.
This sample program demonstrates how to use the atomic package functions Store and Load to provide safe access to numeric types.
listing16 command
This sample program demonstrates how to use a mutex to define critical sections of code that need synchronous access.
This sample program demonstrates how to use a mutex to define critical sections of code that need synchronous access.
listing20 command
This sample program demonstrates how to use an unbuffered channel to simulate a game of tennis between two goroutines.
This sample program demonstrates how to use an unbuffered channel to simulate a game of tennis between two goroutines.
listing22 command
This sample program demonstrates how to use an unbuffered channel to simulate a relay race between four goroutines.
This sample program demonstrates how to use an unbuffered channel to simulate a relay race between four goroutines.
listing24 command
This sample program demonstrates how to use a buffered channel to work on multiple tasks with a predefined number of goroutines.
This sample program demonstrates how to use a buffered channel to work on multiple tasks with a predefined number of goroutines.
chapter7
patterns/pool
Example provided with help from Fatih Arslan and Gabriel Aszalos.
Example provided with help from Fatih Arslan and Gabriel Aszalos.
patterns/pool/main command
This sample program demonstrates how to use the pool package to share a simulated set of database connections.
This sample program demonstrates how to use the pool package to share a simulated set of database connections.
patterns/runner
Example is provided with help by Gabriel Aszalos.
Example is provided with help by Gabriel Aszalos.
patterns/runner/main command
This sample program demonstrates how to use a channel to monitor the amount of time the program is running and terminate the program if it runs too long.
This sample program demonstrates how to use a channel to monitor the amount of time the program is running and terminate the program if it runs too long.
patterns/search
Package search : search.go manages the searching of results against Google, Yahoo and Bing.
Package search : search.go manages the searching of results against Google, Yahoo and Bing.
patterns/search/main command
This sample program demonstrates how to implement a pattern for concurrent requesting results from different systems and either wait for all the results to return or just the first one.
This sample program demonstrates how to implement a pattern for concurrent requesting results from different systems and either wait for all the results to return or just the first one.
patterns/semaphore command
This sample program demonstrates how to implement a semaphore using channels that can allow multiple reads but a single write.
This sample program demonstrates how to implement a semaphore using channels that can allow multiple reads but a single write.
patterns/work
Example provided with help from Jason Waldrip.
Example provided with help from Jason Waldrip.
patterns/work/main command
This sample program demonstrates how to use the work package to use a pool of goroutines to get work done.
This sample program demonstrates how to use the work package to use a pool of goroutines to get work done.
chapter8
listing03 command
This sample program demonstrates how to use the base log package.
This sample program demonstrates how to use the base log package.
listing11 command
This sample program demonstrates how to create customized loggers.
This sample program demonstrates how to create customized loggers.
listing24 command
This sample program demonstrates how to decode a JSON response using the json package and NewDecoder function.
This sample program demonstrates how to decode a JSON response using the json package and NewDecoder function.
listing27 command
This sample program demonstrates how to decode a JSON string.
This sample program demonstrates how to decode a JSON string.
listing29 command
This sample program demonstrates how to decode a JSON string.
This sample program demonstrates how to decode a JSON string.
listing31 command
This sample program demonstrates how to marshal a JSON string.
This sample program demonstrates how to marshal a JSON string.
listing37 command
Sample program to show how different functions from the standard library use the io.Writer interface.
Sample program to show how different functions from the standard library use the io.Writer interface.
listing46 command
Sample program to show how to write a simple version of curl using the io.Reader and io.Writer interface support.
Sample program to show how to write a simple version of curl using the io.Reader and io.Writer interface support.
chapter9
listing17 command
This sample code implement a simple web service.
This sample code implement a simple web service.
listing17/handlers
Package handlers provides the endpoints for the web service.
Package handlers provides the endpoints for the web service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL