Directories ¶
Path | Synopsis |
---|---|
go-learning
|
|
go-study
|
|
src/chapter10/listing01
Sample program demonstrating struct composition.
|
Sample program demonstrating struct composition. |
src/chapter10/listing02
Sample program demonstrating decoupling with interfaces.
|
Sample program demonstrating decoupling with interfaces. |
src/chapter10/listing03
Sample program demonstrating interface composition.
|
Sample program demonstrating interface composition. |
src/chapter10/listing04
Sample program demonstrating decoupling with interface composition.
|
Sample program demonstrating decoupling with interface composition. |
src/chapter10/listing05
Sample program demonstrating when implicit interface conversions are provided by the compiler.
|
Sample program demonstrating when implicit interface conversions are provided by the compiler. |
src/chapter10/listing06
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. |
src/chapter10/listing06/pubsub
Package pubsub simulates a package that provides publication/subscription type services.
|
Package pubsub simulates a package that provides publication/subscription type services. |
src/chapter3/dbdriver
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. |
src/chapter3/wordcount
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. |
src/chapter3/words
Package words provides support for counting words.
|
Package words provides support for counting words. |
src/chapter5/listing11
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. |
src/chapter5/listing34
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. |
src/chapter5/listing35
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. |
src/chapter5/listing36
Sample program to show how to use an interface in Go.
|
Sample program to show how to use an interface in Go. |
src/chapter5/listing46
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. |
src/chapter5/listing48
Sample program to show how polymorphic behavior with interfaces.
|
Sample program to show how polymorphic behavior with interfaces. |
src/chapter5/listing50
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. |
src/chapter5/listing56
Sample program to show how embedded types work with interfaces.
|
Sample program to show how embedded types work with interfaces. |
src/chapter5/listing60
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. |
src/chapter5/listing64
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. |
src/chapter5/listing64/counters
Package counters provides alert counter support.
|
Package counters provides alert counter support. |
src/chapter5/listing68
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. |
src/chapter5/listing68/counters
Package counters provides alert counter support.
|
Package counters provides alert counter support. |
src/chapter5/listing71
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. |
src/chapter5/listing71/entities
Package entities contains support for types of people in the system.
|
Package entities contains support for types of people in the system. |
src/chapter5/listing74
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. |
src/chapter5/listing74/entities
Package entities contains support for types of people in the system.
|
Package entities contains support for types of people in the system. |
src/chapter6/listing01
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. |
src/chapter6/listing04
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. |
src/chapter6/listing07
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. |
src/chapter6/listing09
This sample program demonstrates how to create race conditions in our programs.
|
This sample program demonstrates how to create race conditions in our programs. |
src/chapter6/listing13
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. |
src/chapter6/listing15
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. |
src/chapter6/listing16
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. |
src/chapter6/listing20
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. |
src/chapter6/listing22
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. |
src/chapter6/listing24
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. |
src/chapter7/patterns/pool
Example provided with help from Fatih Arslan and Gabriel Aszalos.
|
Example provided with help from Fatih Arslan and Gabriel Aszalos. |
src/chapter7/patterns/pool/main
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. |
src/chapter7/patterns/runner
Example is provided with help by Gabriel Aszalos.
|
Example is provided with help by Gabriel Aszalos. |
src/chapter7/patterns/runner/main
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. |
src/chapter7/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. |
src/chapter7/patterns/search/main
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. |
src/chapter7/patterns/semaphore
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. |
src/chapter7/patterns/work
Example provided with help from Jason Waldrip.
|
Example provided with help from Jason Waldrip. |
src/chapter7/patterns/work/main
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. |
src/chapter8/listing03
This sample program demonstrates how to use the base log package.
|
This sample program demonstrates how to use the base log package. |
src/chapter8/listing11
This sample program demonstrates how to create customized loggers.
|
This sample program demonstrates how to create customized loggers. |
src/chapter8/listing24
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. |
src/chapter8/listing27
This sample program demonstrates how to decode a JSON string.
|
This sample program demonstrates how to decode a JSON string. |
src/chapter8/listing29
This sample program demonstrates how to decode a JSON string.
|
This sample program demonstrates how to decode a JSON string. |
src/chapter8/listing31
This sample program demonstrates how to marshal a JSON string.
|
This sample program demonstrates how to marshal a JSON string. |
src/chapter8/listing37
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. |
src/chapter8/listing46
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. |
src/chapter9/listing17
This sample code implement a simple web service.
|
This sample code implement a simple web service. |
src/chapter9/listing17/handlers
Package handlers provides the endpoints for the web service.
|
Package handlers provides the endpoints for the web service. |
project-euler
|
|
Click to show internal directories.
Click to hide internal directories.