Documentation ¶
There is no documentation for this package.
Directories ¶
Path | Synopsis |
---|---|
courses
|
|
intro/quick/hello
Sample program to show off Go and check programming environment.
|
Sample program to show off Go and check programming environment. |
intro/quick/helloHTTP
Sample program to show off Go and check programming environment.
|
Sample program to show off Go and check programming environment. |
quick_tour/code/cli
Sample program to show the basics of using flags.
|
Sample program to show the basics of using flags. |
quick_tour/code/concurrency
Basic command line program that accepts arguments.
|
Basic command line program that accepts arguments. |
quick_tour/code/http/webserver
Program to show how to run a basic web server.
|
Program to show how to run a basic web server. |
quick_tour/code/http/webserver1
Program to show how to run a basic web server with routing.
|
Program to show how to run a basic web server with routing. |
quick_tour/code/http/webserver2
Program to show how to run a basic web server with routing and templating.
|
Program to show how to run a basic web server with routing and templating. |
tools
|
|
mpl
Package main provides a CLI tool to automatically update Go Playground links within a training markdown file
|
Package main provides a CLI tool to automatically update Go Playground links within a training markdown file |
topics
|
|
api/composition/assertions/example1
Sample program demonstrating when implicit interface conversions are provided by the compiler.
|
Sample program demonstrating when implicit interface conversions are provided by the compiler. |
api/composition/assertions/example2
Sample program demonstrating that type assertions are a runtime and not compile time construct.
|
Sample program demonstrating that type assertions are a runtime and not compile time construct. |
api/composition/decoupling/example1
Sample program demonstrating struct composition.
|
Sample program demonstrating struct composition. |
api/composition/decoupling/example2
Sample program demonstrating decoupling with interfaces.
|
Sample program demonstrating decoupling with interfaces. |
api/composition/decoupling/example3
Sample program demonstrating interface composition.
|
Sample program demonstrating interface composition. |
api/composition/decoupling/example4
Sample program demonstrating decoupling with interface composition.
|
Sample program demonstrating decoupling with interface composition. |
api/composition/exercises/exercise1
Using the template, declare a set of concrete types that implement the set of predefined interface types.
|
Using the template, declare a set of concrete types that implement the set of predefined interface types. |
api/composition/grouping/example1
This is an example of using type hierarchies with a OOP pattern.
|
This is an example of using type hierarchies with a OOP pattern. |
api/composition/grouping/example2
This is an example of using composition and interfaces.
|
This is an example of using composition and interfaces. |
api/composition/mocking/example1
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. |
api/composition/mocking/example1/pubsub
Package pubsub simulates a package that provides publication/subscription type services.
|
Package pubsub simulates a package that provides publication/subscription type services. |
api/error_handling/example1
Sample program to show how the default error type is implemented.
|
Sample program to show how the default error type is implemented. |
api/error_handling/example2
Sample program to show how to use error variables to help the caller determine the exact error being returned.
|
Sample program to show how to use error variables to help the caller determine the exact error being returned. |
api/error_handling/example3
http://golang.org/src/pkg/encoding/json/decode.go Sample program to show how to implement a custom error type based on the json package in the standard library.
|
http://golang.org/src/pkg/encoding/json/decode.go Sample program to show how to implement a custom error type based on the json package in the standard library. |
api/error_handling/example4
Package example5 provides code to show how to implement behavior as context.
|
Package example5 provides code to show how to implement behavior as context. |
api/error_handling/example5
Sample program to show see if the class can find the bug.
|
Sample program to show see if the class can find the bug. |
api/error_handling/example5/reason
Sample program to show see if the class can find the bug.
|
Sample program to show see if the class can find the bug. |
api/error_handling/exercises/exercise1
Create two error variables, one called ErrInvalidValue and the other called ErrAmountTooLarge.
|
Create two error variables, one called ErrInvalidValue and the other called ErrAmountTooLarge. |
api/error_handling/exercises/exercise2
Create a custom error type called appError that contains three fields, err error, message string and code int.
|
Create a custom error type called appError that contains three fields, err error, message string and code int. |
api/error_handling/exercises/template1
Create two error variables, one called ErrInvalidValue and the other called ErrAmountTooLarge.
|
Create two error variables, one called ErrInvalidValue and the other called ErrAmountTooLarge. |
api/error_handling/exercises/template2
Create a custom error type called appError that contains three fields, err error, message string and code int.
|
Create a custom error type called appError that contains three fields, err error, message string and code int. |
cli/cobra
This program provides a sample building cli tooling.
|
This program provides a sample building cli tooling. |
concurrency/channels/advanced/example1
Sample program to show the order of channel communication for unbuffered, buffered and closing channels based on the specification.
|
Sample program to show the order of channel communication for unbuffered, buffered and closing channels based on the specification. |
concurrency/channels/example1
Sample program to show how to use an unbuffered channel to simulate a game of tennis between two goroutines.
|
Sample program to show how to use an unbuffered channel to simulate a game of tennis between two goroutines. |
concurrency/channels/example2
Sample program to show how to use an unbuffered channel to simulate a relay race between four goroutines.
|
Sample program to show how to use an unbuffered channel to simulate a relay race between four goroutines. |
concurrency/channels/example3
This sample program demonstrates how to use a buffered channel to receive results from other goroutines in a guaranteed way.
|
This sample program demonstrates how to use a buffered channel to receive results from other goroutines in a guaranteed way. |
concurrency/channels/example4
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. |
concurrency/channels/exercises/exercise1
Write a program where two goroutines pass an integer back and forth ten times.
|
Write a program where two goroutines pass an integer back and forth ten times. |
concurrency/channels/exercises/exercise2
Write a program that uses a fan out pattern to generate 100 random numbers concurrently.
|
Write a program that uses a fan out pattern to generate 100 random numbers concurrently. |
concurrency/channels/exercises/template1
Write a program where two goroutines pass an integer back and forth ten times.
|
Write a program where two goroutines pass an integer back and forth ten times. |
concurrency/channels/exercises/template2
Write a program that uses a fan out pattern to generate 100 random numbers concurrently.
|
Write a program that uses a fan out pattern to generate 100 random numbers concurrently. |
concurrency/data_race/advanced/example1
Sample program to show a more complicated race condition using an interface value.
|
Sample program to show a more complicated race condition using an interface value. |
concurrency/data_race/example1
Sample program to show how to create race conditions in our programs.
|
Sample program to show how to create race conditions in our programs. |
concurrency/data_race/example2
Sample program to show how to use the atomic package to provide safe access to numeric types.
|
Sample program to show how to use the atomic package to provide safe access to numeric types. |
concurrency/data_race/example3
Sample program to show how to use the atomic package functions Store and Load to provide safe access to numeric types.
|
Sample program to show how to use the atomic package functions Store and Load to provide safe access to numeric types. |
concurrency/data_race/example4
Sample program to show how to use a mutex to define critical sections of code that need synchronous access.
|
Sample program to show how to use a mutex to define critical sections of code that need synchronous access. |
concurrency/data_race/example5
Sample program to show how to use a read/write mutex to define critical sections of code that needs synchronous access.
|
Sample program to show how to use a read/write mutex to define critical sections of code that needs synchronous access. |
concurrency/data_race/exercises/exercise1
Answer for exercise 1 of Race Conditions.
|
Answer for exercise 1 of Race Conditions. |
concurrency/data_race/exercises/template1
Fix the race condition in this program.
|
Fix the race condition in this program. |
concurrency/goroutines/example1
Sample program to show how to create goroutines and how the scheduler behaves.
|
Sample program to show how to create goroutines and how the scheduler behaves. |
concurrency/goroutines/example2
Sample program to show how the goroutine scheduler will time slice goroutines on a single thread.
|
Sample program to show how the goroutine scheduler will time slice goroutines on a single thread. |
concurrency/goroutines/example3
Sample program to show how to create goroutines and how the goroutine scheduler behaves with two contexts.
|
Sample program to show how to create goroutines and how the goroutine scheduler behaves with two contexts. |
concurrency/goroutines/exercises/exercise1
Create a program that declares two anonymous functions.
|
Create a program that declares two anonymous functions. |
concurrency/goroutines/exercises/template1
Create a program that declares two anonymous functions.
|
Create a program that declares two anonymous functions. |
concurrency/patterns/chat
Package chat implements a basic chat room.
|
Package chat implements a basic chat room. |
concurrency/patterns/chat/main
This sample program demonstrates how to create a simple chat system.
|
This sample program demonstrates how to create a simple chat system. |
concurrency/patterns/logger
Package logger shows a pattern of using a buffer to handle log write continuity but deal with write latencies by throwing away log data.
|
Package logger shows a pattern of using a buffer to handle log write continuity but deal with write latencies by throwing away log data. |
concurrency/patterns/logger/main
This sample program demonstrates how the logger package works.
|
This sample program demonstrates how the logger package works. |
concurrency/patterns/pool
Package pool manages a user defined set of resources.
|
Package pool manages a user defined set of resources. |
concurrency/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. |
concurrency/patterns/task
Package task provides a pool of goroutines to perform tasks.
|
Package task provides a pool of goroutines to perform tasks. |
concurrency/patterns/task/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. |
language/arrays/example1
Sample program to show how to declare and iterate over arrays of different types.
|
Sample program to show how to declare and iterate over arrays of different types. |
language/arrays/example2
Sample program to show how arrays of different sizes are not of the same type.
|
Sample program to show how arrays of different sizes are not of the same type. |
language/arrays/example3
Sample program to show how the behavior of the for range and how memory for an array is contiguous.
|
Sample program to show how the behavior of the for range and how memory for an array is contiguous. |
language/arrays/exercises/exercise1
Declare an array of 5 strings with each element initialized to its zero value.
|
Declare an array of 5 strings with each element initialized to its zero value. |
language/arrays/exercises/template1
Declare an array of 5 strings with each element initialized to its zero value.
|
Declare an array of 5 strings with each element initialized to its zero value. |
language/constants/example1
Sample program to show how to declare constants and their implementation in Go.
|
Sample program to show how to declare constants and their implementation in Go. |
language/constants/example2
Sample program to show how constants do have a parallel type system.
|
Sample program to show how constants do have a parallel type system. |
language/constants/example3
Sample program to show how iota works.
|
Sample program to show how iota works. |
language/constants/exercises/exercise1
Declare an untyped and typed constant and display their values.
|
Declare an untyped and typed constant and display their values. |
language/constants/exercises/template1
Declare an untyped and typed constant and display their values.
|
Declare an untyped and typed constant and display their values. |
language/embedding/example1
Sample program to show how what we are doing is NOT embedding a type but just using a type as a field.
|
Sample program to show how what we are doing is NOT embedding a type but just using a type as a field. |
language/embedding/example2
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. |
language/embedding/example3
Sample program to show how embedded types work with interfaces.
|
Sample program to show how embedded types work with interfaces. |
language/embedding/example4
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. |
language/embedding/exercises/exercise1
Copy the code from the template.
|
Copy the code from the template. |
language/embedding/exercises/template1
Copy the code from the template.
|
Copy the code from the template. |
language/exporting/example1
Sample program to show how to access an exported identifier.
|
Sample program to show how to access an exported identifier. |
language/exporting/example1/counters
Package counters provides alert counter support.
|
Package counters provides alert counter support. |
language/exporting/example2
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. |
language/exporting/example2/counters
Package counters provides alert counter support.
|
Package counters provides alert counter support. |
language/exporting/example3
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. |
language/exporting/example3/counters
Package counters provides alert counter support.
|
Package counters provides alert counter support. |
language/exporting/example4
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. |
language/exporting/example4/users
Package users provides support for user management.
|
Package users provides support for user management. |
language/exporting/example5
Sample program to show how to create values from exported types with embedded unexported types.
|
Sample program to show how to create values from exported types with embedded unexported types. |
language/exporting/example5/users
Package users provides support for user management.
|
Package users provides support for user management. |
language/exporting/exercises/exercise1
Create a package named toy with a single exported struct type named Toy.
|
Create a package named toy with a single exported struct type named Toy. |
language/exporting/exercises/exercise1/toy
Package toy contains support for managing toy inventory.
|
Package toy contains support for managing toy inventory. |
language/exporting/exercises/template1
Create a package named toy with a single exported struct type named Toy.
|
Create a package named toy with a single exported struct type named Toy. |
language/exporting/exercises/template1/toy
Package toy contains support for managing toy inventory.
|
Package toy contains support for managing toy inventory. |
language/functions/advanced/example1
Sample program to show how to recover from panics.
|
Sample program to show how to recover from panics. |
language/functions/example1
Sample program to show how functions can return multiple values while using named and struct types.
|
Sample program to show how functions can return multiple values while using named and struct types. |
language/functions/example2
Sample program to show how we can use the blank identifier to ignore return values.
|
Sample program to show how we can use the blank identifier to ignore return values. |
language/functions/example3
Sample program to show some of the mechanics behind the short variable declaration operator redeclares.
|
Sample program to show some of the mechanics behind the short variable declaration operator redeclares. |
language/functions/example4
Sample program to show how anonymous functions and closures work.
|
Sample program to show how anonymous functions and closures work. |
language/functions/exercises/exercise1
Declare a struct type to maintain information about a user.
|
Declare a struct type to maintain information about a user. |
language/functions/exercises/template1
Declare a struct type to maintain information about a user.
|
Declare a struct type to maintain information about a user. |
language/interfaces/advanced/example1
Sample program that explores how interface assignments work when values are stored inside the interface.
|
Sample program that explores how interface assignments work when values are stored inside the interface. |
language/interfaces/example1
Sample program to show how polymorphic behavior with interfaces.
|
Sample program to show how polymorphic behavior with interfaces. |
language/interfaces/example2
Sample program to show how to understand method sets.
|
Sample program to show how to understand method sets. |
language/interfaces/example3
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. |
language/interfaces/example4
Sample program to show how method sets can affect behavior.
|
Sample program to show how method sets can affect behavior. |
language/interfaces/example5
Sample program to show how the concrete value assigned to the interface is what is stored inside the interface.
|
Sample program to show how the concrete value assigned to the interface is what is stored inside the interface. |
language/interfaces/exercises/exercise1
Declare an interface named speaker with a method named speak.
|
Declare an interface named speaker with a method named speak. |
language/interfaces/exercises/template1
Declare an interface named speaker with a method named speak.
|
Declare an interface named speaker with a method named speak. |
language/maps/example1
Sample program to show how to declare, initialize and iterate over a map.
|
Sample program to show how to declare, initialize and iterate over a map. |
language/maps/example2
Sample program to show how to declare and initialize a map using a map literal and delete a key.
|
Sample program to show how to declare and initialize a map using a map literal and delete a key. |
language/maps/example3
Sample program to show how only types that can have equality defined on them can be a map key.
|
Sample program to show how only types that can have equality defined on them can be a map key. |
language/maps/exercises/exercise1
Declare and make a map of integer values with a string as the key.
|
Declare and make a map of integer values with a string as the key. |
language/maps/exercises/template1
Declare and make a map of integer values with a string as the key.
|
Declare and make a map of integer values with a string as the key. |
language/methods/example1
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. |
language/methods/example2
Sample program to show how to declare methods against a named type.
|
Sample program to show how to declare methods against a named type. |
language/methods/example3
Sample program to show how to declare function variables.
|
Sample program to show how to declare function variables. |
language/methods/example4
Sample program to show how to declare and use function types.
|
Sample program to show how to declare and use function types. |
language/methods/exercises/exercise1
Declare a struct that represents a baseball player.
|
Declare a struct that represents a baseball player. |
language/methods/exercises/template1
Declare a struct that represents a baseball player.
|
Declare a struct that represents a baseball player. |
language/pointers/example1
Sample program to show the basic concept of pass by value.
|
Sample program to show the basic concept of pass by value. |
language/pointers/example2
Sample program to show the basic concept of using a pointer to share data.
|
Sample program to show the basic concept of using a pointer to share data. |
language/pointers/example3
Sample program to show the basic concept of using a pointer to share data.
|
Sample program to show the basic concept of using a pointer to share data. |
language/pointers/example4
Sample program to show variables stay on or escape from the stack.
|
Sample program to show variables stay on or escape from the stack. |
language/pointers/example5
Sample program to show how stacks grow/change.
|
Sample program to show how stacks grow/change. |
language/pointers/exercises/exercise1
Declare and initialize a variable of type int with the value of 20.
|
Declare and initialize a variable of type int with the value of 20. |
language/pointers/exercises/exercise2
Declare a struct type and create a value of this type.
|
Declare a struct type and create a value of this type. |
language/pointers/exercises/template1
Declare and initialize a variable of type int with the value of 20.
|
Declare and initialize a variable of type int with the value of 20. |
language/pointers/exercises/template2
Declare a struct type and create a value of this type.
|
Declare a struct type and create a value of this type. |
language/receiver_choices/exercises/exercise1
Declare a struct type named Point with two fields, X and Y of type int.
|
Declare a struct type named Point with two fields, X and Y of type int. |
language/receiver_choices/exercises/template1
Declare a struct type named Point with two fields, X and Y of type int.
|
Declare a struct type named Point with two fields, X and Y of type int. |
language/slices/advanced/example1
Sample program to show how to use a third index slice.
|
Sample program to show how to use a third index slice. |
language/slices/example1
Sample program to show how the capacity of the slice is not available for use.
|
Sample program to show how the capacity of the slice is not available for use. |
language/slices/example2
Sample program to show the components of a slice.
|
Sample program to show the components of a slice. |
language/slices/example3
Sample program to show how to takes slices of slices to create different views of and make changes to the underlying array.
|
Sample program to show how to takes slices of slices to create different views of and make changes to the underlying array. |
language/slices/example4
Sample program to show how to grow a slice using the built-in function append and how append grows the capacity of the underlying array.
|
Sample program to show how to grow a slice using the built-in function append and how append grows the capacity of the underlying array. |
language/slices/example5
Sample program to show how one needs to be careful when appending to a slice when you have a reference to an element.
|
Sample program to show how one needs to be careful when appending to a slice when you have a reference to an element. |
language/slices/example6
Sample program to show how strings have a UTF-8 encoded byte array.
|
Sample program to show how strings have a UTF-8 encoded byte array. |
language/slices/example7
Sample program to show how to declare and use variadic functions.
|
Sample program to show how to declare and use variadic functions. |
language/slices/exercises/exercise1
Declare a nil slice of integers.
|
Declare a nil slice of integers. |
language/slices/exercises/template1
Declare a nil slice of integers.
|
Declare a nil slice of integers. |
language/struct_types/advanced/example1
Sample program to show how struct types align on boundaries.
|
Sample program to show how struct types align on boundaries. |
language/struct_types/example1
Sample program to show how to declare and initialize struct types.
|
Sample program to show how to declare and initialize struct types. |
language/struct_types/example2
Sample program to show how to declare and initialize anonymous struct types.
|
Sample program to show how to declare and initialize anonymous struct types. |
language/struct_types/example3
Sample program to show how variables of an unnamed type can be assigned to variables of a named type, when they are identical.
|
Sample program to show how variables of an unnamed type can be assigned to variables of a named type, when they are identical. |
language/struct_types/exercises/exercise1
Declare a struct type to maintain information about a user (name, email and age).
|
Declare a struct type to maintain information about a user (name, email and age). |
language/struct_types/exercises/template1
Declare a struct type to maintain information about a user (name, email and age).
|
Declare a struct type to maintain information about a user (name, email and age). |
language/type_conversions/example1
Sample program to show how to declare and use a named type.
|
Sample program to show how to declare and use a named type. |
language/type_conversions/example2
Sample program to show a idiomatic use of named types from the standard library and how they work in concert with other Go concepts.
|
Sample program to show a idiomatic use of named types from the standard library and how they work in concert with other Go concepts. |
language/type_conversions/example3
Sample program to show a idiomatic use of named types from the standard library and how they work in concert with other Go concepts.
|
Sample program to show a idiomatic use of named types from the standard library and how they work in concert with other Go concepts. |
language/type_conversions/example4
Sample program to show a idiomatic use of named types from the standard library and how they work in concert with other Go concepts.
|
Sample program to show a idiomatic use of named types from the standard library and how they work in concert with other Go concepts. |
language/type_conversions/exercises/exercise1
Declare a named type called counter with a base type of int.
|
Declare a named type called counter with a base type of int. |
language/type_conversions/exercises/template1
Declare a named type called counter with a base type of int.
|
Declare a named type called counter with a base type of int. |
language/variables/example1
Sample program to show how to declare variables.
|
Sample program to show how to declare variables. |
language/variables/exercises/exercise1
Declare three variables that are initialized to their zero value and three declared with a literal value.
|
Declare three variables that are initialized to their zero value and three declared with a literal value. |
language/variables/exercises/template1
Declare three variables that are initialized to their zero value and three declared with a literal value.
|
Declare three variables that are initialized to their zero value and three declared with a literal value. |
nats/basic/async
Sample program to show to connect and publish/subscribe for messages.
|
Sample program to show to connect and publish/subscribe for messages. |
nats/basic/channels
Sample program to show to connect and publish/subscribe for messages.
|
Sample program to show to connect and publish/subscribe for messages. |
nats/basic/queue
Sample program to show to using the queuing functionality to allow a round robin of services to handle messages.
|
Sample program to show to using the queuing functionality to allow a round robin of services to handle messages. |
nats/basic/request
Sample program to show to connect and publish/subscribe requests.
|
Sample program to show to connect and publish/subscribe requests. |
nats/basic/sync
Sample program to show to connect and publish/subscribe for messages.
|
Sample program to show to connect and publish/subscribe for messages. |
nats/chat
Sample program to show how to build a very basic chat client using NATS.
|
Sample program to show how to build a very basic chat client using NATS. |
nats/services/basic/db
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 Sample program to show what a basic web service might look like.
|
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 Sample program to show what a basic web service might look like. |
nats/services/basic/web
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 Sample program to show what a basic web service might look like.
|
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 Sample program to show what a basic web service might look like. |
packages/context/example1
Sample program to show how to store and retrieve values from a context.
|
Sample program to show how to store and retrieve values from a context. |
packages/context/example2
Sample program to show how to use the WithCancel function of the Context package.
|
Sample program to show how to use the WithCancel function of the Context package. |
packages/context/example3
Sample program to show how to use the WithDeadline function of the Context package.
|
Sample program to show how to use the WithDeadline function of the Context package. |
packages/context/example4
Sample program to show how to use the WithTimeout function of the Context package.
|
Sample program to show how to use the WithTimeout function of the Context package. |
packages/context/example5
Sample program that implements a web request with a context that is used to timeout the request if it takes too long.
|
Sample program that implements a web request with a context that is used to timeout the request if it takes too long. |
packages/context/exercises/exercise1
Sample program that implements a simple web service using the context to handle timeouts and pass context into the request.
|
Sample program that implements a simple web service using the context to handle timeouts and pass context into the request. |
packages/encoding/example1
Sample program to show how to unmarshal a JSON document into a user defined struct type.
|
Sample program to show how to unmarshal a JSON document into a user defined struct type. |
packages/encoding/example2
Sample program to show how to unmarshal a JSON document into a user defined struct type from a file.
|
Sample program to show how to unmarshal a JSON document into a user defined struct type from a file. |
packages/encoding/example3
Sample program to show how to marshal a user defined struct type into a string.
|
Sample program to show how to marshal a user defined struct type into a string. |
packages/encoding/example4
Sample program to show how write a custom Unmarshal and Marshal functions.
|
Sample program to show how write a custom Unmarshal and Marshal functions. |
packages/encoding/exercises/exercise1
Create a file with an array of JSON documents that contain a user name and email address.
|
Create a file with an array of JSON documents that contain a user name and email address. |
packages/encoding/exercises/template1
Create a file with an array of JSON documents that contain a user name and email address.
|
Create a file with an array of JSON documents that contain a user name and email address. |
packages/http/api
This program provides a sample web service that implements a RESTFul CRUD API against a MongoDB database.
|
This program provides a sample web service that implements a RESTFul CRUD API against a MongoDB database. |
packages/http/api/app
Package app provides a thin layer of support for writing web services.
|
Package app provides a thin layer of support for writing web services. |
packages/io/advanced/example1
Sample program to show how io.Writes can be embedded within other Writer calls to perform complex writes.
|
Sample program to show how io.Writes can be embedded within other Writer calls to perform complex writes. |
packages/io/advanced/example2
Sample program that adds a few more features.
|
Sample program that adds a few more features. |
packages/io/example1
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. |
packages/io/example2
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. |
packages/io/example3
Sample program to show how to use a MultiWriter to perform writes to multiple devices with one write call.
|
Sample program to show how to use a MultiWriter to perform writes to multiple devices with one write call. |
packages/io/example4
Sample program that takes a stream of bytes and looks for the bytes “elvis” and when they are found, replace them with “Elvis”.
|
Sample program that takes a stream of bytes and looks for the bytes “elvis” and when they are found, replace them with “Elvis”. |
packages/io/exercises/exercise1
Download any document from the web and display the content in the terminal and write it to a file at the same time.
|
Download any document from the web and display the content in the terminal and write it to a file at the same time. |
packages/io/exercises/template1
Download any document from the web and display the content in the terminal and write it to a file at the same time.
|
Download any document from the web and display the content in the terminal and write it to a file at the same time. |
packages/logging/example1
Sample program to show how to use the log package from the standard library.
|
Sample program to show how to use the log package from the standard library. |
packages/logging/example2
Sample program to show how to extend the log package from the standard library.
|
Sample program to show how to extend the log package from the standard library. |
packages/logging/exercises/exercise1
Setup a new program to use the log package.
|
Setup a new program to use the log package. |
packages/logging/exercises/template1
Setup a new program to use the log package.
|
Setup a new program to use the log package. |
packages/reflection/exercises/exercise1
Declare a struct type that represents a request for a customer invoice.
|
Declare a struct type that represents a request for a customer invoice. |
packages/reflection/exercises/template1
Declare a struct type that represents a request for a customer invoice.
|
Declare a struct type that represents a request for a customer invoice. |
packages/reflection/inspect/integer
Example shows how to use reflection to decode an integer.
|
Example shows how to use reflection to decode an integer. |
packages/reflection/inspect/struct
Example shows how to inspect a structs fields and display the field name, type and value.
|
Example shows how to inspect a structs fields and display the field name, type and value. |
packages/reflection/interface/map
Example shows how to reflect over a map of struct type values that are stored inside an interface value.
|
Example shows how to reflect over a map of struct type values that are stored inside an interface value. |
packages/reflection/interface/pointer
Example shows how to reflect over a struct type pointer that is stored inside an interface value.
|
Example shows how to reflect over a struct type pointer that is stored inside an interface value. |
packages/reflection/interface/slice
Example shows how to reflect over a slice of struct type values that are stored inside an interface value.
|
Example shows how to reflect over a slice of struct type values that are stored inside an interface value. |
packages/reflection/interface/struct
Example shows how to reflect over a struct type value that is stored inside an interface value.
|
Example shows how to reflect over a struct type value that is stored inside an interface value. |
packages/reflection/tag
Example shows how to reflect on a struct type with tags.
|
Example shows how to reflect on a struct type with tags. |
profiling/godebug/gctrace
Sample program to see what a memory leak looks like.
|
Sample program to see what a memory leak looks like. |
profiling/godebug/schedtrace
Sample program that implements a simple web service that will allow us to explore how to use the schedtrace.
|
Sample program that implements a simple web service that will allow us to explore how to use the schedtrace. |
profiling/http_trace/example1
Sample program to show how the httptrace package provides a number of hooks to gather information during an HTTP round trip about a variety of events.
|
Sample program to show how the httptrace package provides a number of hooks to gather information during an HTTP round trip about a variety of events. |
profiling/http_trace/example2
Sample program to show how to use the http trace with a unique Client and Transport.
|
Sample program to show how to use the http trace with a unique Client and Transport. |
profiling/memcpu
Sample program that takes a stream of bytes and looks for the bytes “elvis” and when they are found, replace them with “Elvis”.
|
Sample program that takes a stream of bytes and looks for the bytes “elvis” and when they are found, replace them with “Elvis”. |
profiling/project
This program provides a sample web service that uses concurrency and channels to perform a coordinated set of asynchronous searches.
|
This program provides a sample web service that uses concurrency and channels to perform a coordinated set of asynchronous searches. |
profiling/project/search
Package search manages the searching of results against different news feeds.
|
Package search manages the searching of results against different news feeds. |
profiling/project/service
Package service maintains the logic for the web service.
|
Package service maintains the logic for the web service. |
profiling/stack_trace/example1
Sample program to show how to read a stack trace.
|
Sample program to show how to read a stack trace. |
profiling/stack_trace/example2
Sample program to show how to read a stack trace when it packs values.
|
Sample program to show how to read a stack trace when it packs values. |
testing/benchmarks/caching
Package caching provides code to show why Data Oriented Design matters.
|
Package caching provides code to show why Data Oriented Design matters. |
testing/fuzzing/example1
Package api provides an example on how to use go-fuzz.
|
Package api provides an example on how to use go-fuzz. |
testing/fuzzing/exercises/exercise1
Package fuzzprot provides the ability to unpack user values from our binary protocol.
|
Package fuzzprot provides the ability to unpack user values from our binary protocol. |
testing/tests/example4
Sample program that implements a simple web service.
|
Sample program that implements a simple web service. |
testing/tests/example4/handlers
Package handlers provides the endpoints for the web service.
|
Package handlers provides the endpoints for the web service. |
Click to show internal directories.
Click to hide internal directories.