Documentation ¶
There is no documentation for this package.
Directories ¶
Path | Synopsis |
---|---|
starter-kits
|
|
http/cmd/apid
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. |
http/internal/platform/web
Package web provides a thin layer of support for writing web services.
|
Package web provides a thin layer of support for writing web services. |
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
|
|
data/caching/example1
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./example1 Sample program to show how to cache data from an API.
|
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./example1 Sample program to show how to cache data from an API. |
data/caching/example2
Sample program to save data from an API in an embedded k/v store.
|
Sample program to save data from an API in an embedded k/v store. |
data/caching/exercises/exercise1
Sample program to show how to cache data from an API, and then use that data in analyzing a dataset.
|
Sample program to show how to cache data from an API, and then use that data in analyzing a dataset. |
data/caching/exercises/template1
Sample program to show how to cache data from an API, and then use that data in analyzing a dataset.
|
Sample program to show how to cache data from an API, and then use that data in analyzing a dataset. |
data/classification_kNN/example1
Sample program to profile our data set.
|
Sample program to profile our data set. |
data/classification_kNN/example2
Sample program to train and validate a kNN model with cross validation.
|
Sample program to train and validate a kNN model with cross validation. |
data/classification_kNN/exercises/exercise1
Program for finding an optimal k value for a k nearest neighbors model.
|
Program for finding an optimal k value for a k nearest neighbors model. |
data/classification_kNN/exercises/template1
Program for finding an optimal k value for a k nearest neighbors model.
|
Program for finding an optimal k value for a k nearest neighbors model. |
data/classification_trees/example1
Sample program to train and validate a decision tree model with cross validation.
|
Sample program to train and validate a decision tree model with cross validation. |
data/classification_trees/example2
Sample program to determine an optimal value of the decision tree pruning parameter.
|
Sample program to determine an optimal value of the decision tree pruning parameter. |
data/classification_trees/exercises/exercise1
Sample program to visualize the accuracy of models with various decision tree pruning parameters.
|
Sample program to visualize the accuracy of models with various decision tree pruning parameters. |
data/classification_trees/exercises/template1
Sample program to visualize the accuracy of models with various decision tree pruning parameters.
|
Sample program to visualize the accuracy of models with various decision tree pruning parameters. |
data/containers/example1
Sample program to train a regression model with a single independent variable.
|
Sample program to train a regression model with a single independent variable. |
data/containers/example2
Sample program to predict based on a persisted regression model.
|
Sample program to predict based on a persisted regression model. |
data/containers/exercises/exercise1
Sample program to train a regression model with multiple independent variables.
|
Sample program to train a regression model with multiple independent variables. |
data/containers/exercises/template1
Sample program to train a regression model with multiple independent variables.
|
Sample program to train a regression model with multiple independent variables. |
data/csv_cleaning/example1
Sample program to read in records from an example CSV file to a dataframe.
|
Sample program to read in records from an example CSV file to a dataframe. |
data/csv_cleaning/example2
Sample program to create a dataframe and subsequently filter and subset the dataframe.
|
Sample program to create a dataframe and subsequently filter and subset the dataframe. |
data/csv_cleaning/example3
Sample program to register of CSV file as an in-memory SQL database and execute SQL queries on the CSV.
|
Sample program to register of CSV file as an in-memory SQL database and execute SQL queries on the CSV. |
data/csv_cleaning/example4
Sample program to register of CSV file as an in-memory SQL database and execute SQL queries on the CSV.
|
Sample program to register of CSV file as an in-memory SQL database and execute SQL queries on the CSV. |
data/csv_cleaning/exercises/exercise1
Sample program to read in a CSV, create three filtered datasets, and save those datasets to three separate files.
|
Sample program to read in a CSV, create three filtered datasets, and save those datasets to three separate files. |
data/csv_cleaning/exercises/exercise2
Sample program to register of CSV file as an in-memory SQL database, sum float columns, and output a process CSV.
|
Sample program to register of CSV file as an in-memory SQL database, sum float columns, and output a process CSV. |
data/csv_cleaning/exercises/template1
Sample program to read in a CSV, create three filtered datasets, and save those datasets to three separate files.
|
Sample program to read in a CSV, create three filtered datasets, and save those datasets to three separate files. |
data/csv_cleaning/exercises/template2
Sample program to register of CSV file as an in-memory SQL database, sum float columns, and output a process CSV.
|
Sample program to register of CSV file as an in-memory SQL database, sum float columns, and output a process CSV. |
data/csv_io/example1
Sample program to read in records from an example CSV file.
|
Sample program to read in records from an example CSV file. |
data/csv_io/example2
Sample program to read in records from an example CSV file, and catch an unexpected extra field in the data.
|
Sample program to read in records from an example CSV file, and catch an unexpected extra field in the data. |
data/csv_io/example3
Sample program to read in records from an example CSV file, and catch an unexpected types in a single column.
|
Sample program to read in records from an example CSV file, and catch an unexpected types in a single column. |
data/csv_io/example4
Sample program to save records to a CSV file.
|
Sample program to save records to a CSV file. |
data/csv_io/exercises/exercise1
Sample program to read in records from an example CSV file, and catch an unexpected types in any of the columns.
|
Sample program to read in records from an example CSV file, and catch an unexpected types in any of the columns. |
data/csv_io/exercises/exercise2
Sample program to read in records from an example CSV file, catch an unexpected types in any of the columns, and output processed data to a different CSV file.
|
Sample program to read in records from an example CSV file, catch an unexpected types in any of the columns, and output processed data to a different CSV file. |
data/csv_io/exercises/template1
Sample program to read in records from an example CSV file, and catch an unexpected types in any of the columns.
|
Sample program to read in records from an example CSV file, and catch an unexpected types in any of the columns. |
data/csv_io/exercises/template2
Sample program to read in records from an example CSV file, catch an unexpected types in any of the columns, and output processed data to a different CSV file.
|
Sample program to read in records from an example CSV file, catch an unexpected types in any of the columns, and output processed data to a different CSV file. |
data/data_versioning/example1
Sample program that connects to a running instance of Pachyderm.
|
Sample program that connects to a running instance of Pachyderm. |
data/data_versioning/example2
Sample program that creates a pachyderm data repository.
|
Sample program that creates a pachyderm data repository. |
data/data_versioning/example3
Sample program that commits data into Pachyderm data versioning.
|
Sample program that commits data into Pachyderm data versioning. |
data/data_versioning/example4
Sample program that gets a versioned dataset/file from Pachyderm.
|
Sample program that gets a versioned dataset/file from Pachyderm. |
data/data_versioning/exercises/exercise1
Sample program that creates a pachyderm data repository.
|
Sample program that creates a pachyderm data repository. |
data/data_versioning/exercises/exercise2
Sample program that commits data into pachyderm's data versioning.
|
Sample program that commits data into pachyderm's data versioning. |
data/data_versioning/exercises/template1
Sample program that creates a pachyderm data repository.
|
Sample program that creates a pachyderm data repository. |
data/data_versioning/exercises/template2
Sample program that commits data into pachyderm's data versioning.
|
Sample program that commits data into pachyderm's data versioning. |
data/dimensionality_reduction/example1
Sample program to illustrate the calculation of principal components.
|
Sample program to illustrate the calculation of principal components. |
data/dimensionality_reduction/example2
Sample program to visualize the impact of dimensionality reduction.
|
Sample program to visualize the impact of dimensionality reduction. |
data/dimensionality_reduction/example3
Sample program to project iris data on to principal components.
|
Sample program to project iris data on to principal components. |
data/dimensionality_reduction/exercises/exercise1
Sample program to project iris data on to 3 principal components.
|
Sample program to project iris data on to 3 principal components. |
data/dimensionality_reduction/exercises/template1
Sample program to project iris data on to 3 principal components.
|
Sample program to project iris data on to 3 principal components. |
data/evaluation/example1
Sample program to calculate an R^2 value.
|
Sample program to calculate an R^2 value. |
data/evaluation/example2
Sample program to calculate a mean absolute error.
|
Sample program to calculate a mean absolute error. |
data/evaluation/example3
Sample program to calculate a accuracy.
|
Sample program to calculate a accuracy. |
data/evaluation/example4
Sample program to calculate precision.
|
Sample program to calculate precision. |
data/evaluation/example5
Sample program to calculate recall.
|
Sample program to calculate recall. |
data/evaluation/exercises/exercise1
Sample program to calculate specificity.
|
Sample program to calculate specificity. |
data/evaluation/exercises/exercise2
Sample program to calculate a mean squared error.
|
Sample program to calculate a mean squared error. |
data/evaluation/exercises/template1
Sample program to calculate specificity.
|
Sample program to calculate specificity. |
data/evaluation/exercises/template2
Sample program to calculate a mean squared error.
|
Sample program to calculate a mean squared error. |
data/hypothesis_testing/example1
Sample program to calculate expected values.
|
Sample program to calculate expected values. |
data/hypothesis_testing/example2
Sample program to calculate a chi-squared value.
|
Sample program to calculate a chi-squared value. |
data/hypothesis_testing/example3
Sample program to output the result of the test, based on a critical value.
|
Sample program to output the result of the test, based on a critical value. |
data/integrity/example2
Sample program to compare parsing a clean CSV with Go to parsing a clean CSV with python.
|
Sample program to compare parsing a clean CSV with Go to parsing a clean CSV with python. |
data/integrity/example4
Sample program to illustrate maintaining integrity with Go in the presence of messy data.
|
Sample program to illustrate maintaining integrity with Go in the presence of messy data. |
data/integrity/exercises/exercise1
Sample program to illustrate maintaining integrity with Go in the presence of messy data.
|
Sample program to illustrate maintaining integrity with Go in the presence of messy data. |
data/integrity/exercises/template1
Sample program to illustrate maintaining integrity with Go in the presence of messy data.
|
Sample program to illustrate maintaining integrity with Go in the presence of messy data. |
data/json/example1
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./example1 Sample program to show how to unmarshal JSON data from an API.
|
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./example1 Sample program to show how to unmarshal JSON data from an API. |
data/json/example2
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./example1 Sample program to show how to save JSON data to a file.
|
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./example1 Sample program to show how to save JSON data to a file. |
data/json/exercises/exercise1
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./exercise1 Sample program to show how to unmarshal JSON data from an API.
|
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./exercise1 Sample program to show how to unmarshal JSON data from an API. |
data/json/exercises/template1
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./template1 Sample program to show how to unmarshal JSON data from an API.
|
All material is licensed under the Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0 go build ./template1 Sample program to show how to unmarshal JSON data from an API. |
data/matrices/example1
Sample program to read in records from an example CSV file and form a matrix with gonum.
|
Sample program to read in records from an example CSV file and form a matrix with gonum. |
data/matrices/example2
Sample program to show modifications to matrices.
|
Sample program to show modifications to matrices. |
data/matrices/example3
Sample program to access values within a matrix.
|
Sample program to access values within a matrix. |
data/matrices/example4
Sample program to illustrate various ways to format matrix output.
|
Sample program to illustrate various ways to format matrix output. |
data/matrices/exercises/exercise1
Sample program to read in records from a CSV file and form a matrix with gonum.
|
Sample program to read in records from a CSV file and form a matrix with gonum. |
data/matrices/exercises/template1
Sample program to read in records from a CSV file and form a matrix with gonum.
|
Sample program to read in records from a CSV file and form a matrix with gonum. |
data/matrix_operations/example1
Sample program to show basic matrix operations.
|
Sample program to show basic matrix operations. |
data/matrix_operations/example2
Sample program to compute the transpose, determinant, and inverse of a matrix.
|
Sample program to compute the transpose, determinant, and inverse of a matrix. |
data/matrix_operations/example3
Sample program to solve an eigenvalue/vector problem.
|
Sample program to solve an eigenvalue/vector problem. |
data/matrix_operations/example4
Sample program to compute vector and matrix norms.
|
Sample program to compute vector and matrix norms. |
data/matrix_operations/exercises/exercise1
Sample program to divide a matrix by its norm.
|
Sample program to divide a matrix by its norm. |
data/matrix_operations/exercises/template1
Sample program to divide a matrix by its norm.
|
Sample program to divide a matrix by its norm. |
data/regression/example1
Sample program to profile our data set.
|
Sample program to profile our data set. |
data/regression/example2
Sample program to investigate correlations between our target and our features.
|
Sample program to investigate correlations between our target and our features. |
data/regression/example3
Sample program to create training, test, and holdout data sets.
|
Sample program to create training, test, and holdout data sets. |
data/regression/example4
Sample program to train and test a regression model.
|
Sample program to train and test a regression model. |
data/regression/example5
Sample program to validate a trained regression model on a holdout data set.
|
Sample program to validate a trained regression model on a holdout data set. |
data/regression/exercises/exercise1b
Sample program to train and test a multiple regression model.
|
Sample program to train and test a multiple regression model. |
data/regression/exercises/exercise1c
Sample program to validate a trained multiple regression model on a holdout data set.
|
Sample program to validate a trained multiple regression model on a holdout data set. |
data/regression/exercises/template1b
Sample program to train and test a multiple regression model.
|
Sample program to train and test a multiple regression model. |
data/regression/exercises/template1c
Sample program to validate a trained multiple regression model on a holdout data set.
|
Sample program to validate a trained multiple regression model on a holdout data set. |
data/sql/example1
Sample program to connect to and ping a database connection.
|
Sample program to connect to and ping a database connection. |
data/sql/example2
Sample program to load the iris dataset into a database.
|
Sample program to load the iris dataset into a database. |
data/sql/example3
Sample program to retrieve results from a database.
|
Sample program to retrieve results from a database. |
data/sql/example4
Sample program to modify data in a database.
|
Sample program to modify data in a database. |
data/sql/exercises/exercise1
Sample program to retrieve results from a database.
|
Sample program to retrieve results from a database. |
data/sql/exercises/exercise2
Sample program to delete rows in a database table.
|
Sample program to delete rows in a database table. |
data/sql/exercises/template1
Sample program to retrieve results from a database.
|
Sample program to retrieve results from a database. |
data/sql/exercises/template2
Sample program to delete rows in a database table.
|
Sample program to delete rows in a database table. |
data/stats_measures/example1
Sample program to calculate means, modes, and medians.
|
Sample program to calculate means, modes, and medians. |
data/stats_measures/example2
Sample program to calculate min, max, and range.
|
Sample program to calculate min, max, and range. |
data/stats_measures/example3
Sample program to calculate standard deviation and variance.
|
Sample program to calculate standard deviation and variance. |
data/stats_measures/example4
Sample program to calculate quantiles
|
Sample program to calculate quantiles |
data/stats_measures/exercises/exercise1
Sample program to calculate both central tendency and statistical dispersion measures for the iris dataset.
|
Sample program to calculate both central tendency and statistical dispersion measures for the iris dataset. |
data/stats_measures/exercises/template1
Sample program to calculate both central tendency and statistical dispersion measures for the iris dataset.
|
Sample program to calculate both central tendency and statistical dispersion measures for the iris dataset. |
data/stats_visualization/example1
Sample program to generate a histogram of a normal distribution.
|
Sample program to generate a histogram of a normal distribution. |
data/stats_visualization/example2
Sample program to generate a histogram of the iris data variables.
|
Sample program to generate a histogram of the iris data variables. |
data/stats_visualization/example3
Sample program to generate a box plot of example distributions.
|
Sample program to generate a box plot of example distributions. |
data/stats_visualization/example4
Sample program to generate box plots of the iris data variables.
|
Sample program to generate box plots of the iris data variables. |
data/stats_visualization/exercises/exercise1
Sample program to generate a box plot of diabetes bmi values.
|
Sample program to generate a box plot of diabetes bmi values. |
data/stats_visualization/exercises/exercise2
Sample program to generate a histogram of diabetes bmi values.
|
Sample program to generate a histogram of diabetes bmi values. |
data/stats_visualization/exercises/template1
Sample program to generate a box plot of diabetes bmi values.
|
Sample program to generate a box plot of diabetes bmi values. |
data/stats_visualization/exercises/template2
Sample program to generate a histogram of diabetes bmi values.
|
Sample program to generate a histogram of diabetes bmi values. |
go/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. |
go/concurrency/channels/example1
This sample program demonstrates the basic channel mechanics for goroutine signaling.
|
This sample program demonstrates the basic channel mechanics for goroutine signaling. |
go/concurrency/channels/example2
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. |
go/concurrency/channels/example3
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. |
go/concurrency/channels/example4
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. |
go/concurrency/channels/example5
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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/concurrency/data_race/example3
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. |
go/concurrency/data_race/example4
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. |
go/concurrency/data_race/exercises/exercise1
Answer for exercise 1 of Race Conditions.
|
Answer for exercise 1 of Race Conditions. |
go/concurrency/data_race/exercises/template1
Fix the race condition in this program.
|
Fix the race condition in this program. |
go/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. |
go/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. |
go/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. |
go/concurrency/goroutines/exercises/exercise1
Create a program that declares two anonymous functions.
|
Create a program that declares two anonymous functions. |
go/concurrency/goroutines/exercises/template1
Create a program that declares two anonymous functions.
|
Create a program that declares two anonymous functions. |
go/concurrency/patterns/chat
Package chat implements a basic chat room.
|
Package chat implements a basic chat room. |
go/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. |
go/concurrency/patterns/logger
Package logger shows a pattern of using a buffer to handle log write continuity by dealing with write latencies by throwing away log data.
|
Package logger shows a pattern of using a buffer to handle log write continuity by dealing with write latencies by throwing away log data. |
go/concurrency/patterns/logger/main
This sample program demonstrates how the logger package works.
|
This sample program demonstrates how the logger package works. |
go/concurrency/patterns/pool
Package pool manages a user defined set of resources.
|
Package pool manages a user defined set of resources. |
go/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. |
go/concurrency/patterns/task
Package task provides a pool of goroutines to perform tasks.
|
Package task provides a pool of goroutines to perform tasks. |
go/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. |
go/design/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. |
go/design/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. |
go/design/composition/assertions/example3
Sample program to show how method sets can affect behavior.
|
Sample program to show how method sets can affect behavior. |
go/design/composition/decoupling/example1
Sample program demonstrating struct composition.
|
Sample program demonstrating struct composition. |
go/design/composition/decoupling/example2
Sample program demonstrating decoupling with interfaces.
|
Sample program demonstrating decoupling with interfaces. |
go/design/composition/decoupling/example3
Sample program demonstrating interface composition.
|
Sample program demonstrating interface composition. |
go/design/composition/decoupling/example4
Sample program demonstrating decoupling with interface composition.
|
Sample program demonstrating decoupling with interface composition. |
go/design/composition/decoupling/example5
Sample program demonstrating removing interface pollution.
|
Sample program demonstrating removing interface pollution. |
go/design/composition/decoupling/example6
Sample program demonstrating being more precise with API design.
|
Sample program demonstrating being more precise with API design. |
go/design/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. |
go/design/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. |
go/design/composition/grouping/example2
This is an example of using composition and interfaces.
|
This is an example of using composition and interfaces. |
go/design/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. |
go/design/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. |
go/design/composition/pollution/example1
This is an example that creates interface pollution by improperly using an interface when one is not needed.
|
This is an example that creates interface pollution by improperly using an interface when one is not needed. |
go/design/composition/pollution/example2
This is an example that removes the interface pollution by removing the interface and using the concrete type directly.
|
This is an example that removes the interface pollution by removing the interface and using the concrete type directly. |
go/design/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. |
go/design/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. |
go/design/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. |
go/design/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. |
go/design/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. |
go/design/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. |
go/design/error_handling/example6
Sample program to show how wrapping errors work.
|
Sample program to show how wrapping errors work. |
go/design/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. |
go/design/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. |
go/design/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. |
go/design/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. |
go/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. |
go/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. |
go/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. |
go/language/arrays/example4
Sample program to show how the for range has both value and pointer semantics.
|
Sample program to show how the for range has both value and pointer semantics. |
go/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. |
go/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. |
go/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. |
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. |
go/language/constants/example3
Sample program to show how iota works.
|
Sample program to show how iota works. |
go/language/constants/example4
Sample program to show how literal, constant and variables work within the scope of implicit conversion.
|
Sample program to show how literal, constant and variables work within the scope of implicit conversion. |
go/language/constants/exercises/exercise1
Declare an untyped and typed constant and display their values.
|
Declare an untyped and typed constant and display their values. |
go/language/constants/exercises/template1
Declare an untyped and typed constant and display their values.
|
Declare an untyped and typed constant and display their values. |
go/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. |
go/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. |
go/language/embedding/example3
Sample program to show how embedded types work with interfaces.
|
Sample program to show how embedded types work with interfaces. |
go/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. |
go/language/embedding/exercises/exercise1
Copy the code from the template.
|
Copy the code from the template. |
go/language/embedding/exercises/template1
Copy the code from the template.
|
Copy the code from the template. |
go/language/exporting/example1
Sample program to show how to access an exported identifier.
|
Sample program to show how to access an exported identifier. |
go/language/exporting/example1/counters
Package counters provides alert counter support.
|
Package counters provides alert counter support. |
go/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. |
go/language/exporting/example2/counters
Package counters provides alert counter support.
|
Package counters provides alert counter support. |
go/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. |
go/language/exporting/example3/counters
Package counters provides alert counter support.
|
Package counters provides alert counter support. |
go/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. |
go/language/exporting/example4/users
Package users provides support for user management.
|
Package users provides support for user management. |
go/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. |
go/language/exporting/example5/users
Package users provides support for user management.
|
Package users provides support for user management. |
go/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. |
go/language/exporting/exercises/exercise1/toy
Package toy contains support for managing toy inventory.
|
Package toy contains support for managing toy inventory. |
go/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. |
go/language/exporting/exercises/template1/toy
Package toy contains support for managing toy inventory.
|
Package toy contains support for managing toy inventory. |
go/language/functions/advanced/example1
Sample program to show how to recover from panics.
|
Sample program to show how to recover from panics. |
go/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. |
go/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. |
go/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. |
go/language/functions/example4
Sample program to show how anonymous functions and closures work.
|
Sample program to show how anonymous functions and closures work. |
go/language/functions/exercises/exercise1
Declare a struct type to maintain information about a user.
|
Declare a struct type to maintain information about a user. |
go/language/functions/exercises/template1
Declare a struct type to maintain information about a user.
|
Declare a struct type to maintain information about a user. |
go/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. |
go/language/interfaces/example1
Sample program to show how polymorphic behavior with interfaces.
|
Sample program to show how polymorphic behavior with interfaces. |
go/language/interfaces/example2
Sample program to show how to understand method sets.
|
Sample program to show how to understand method sets. |
go/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. |
go/language/interfaces/example4
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. |
go/language/interfaces/exercises/exercise1
Declare an interface named speaker with a method named speak.
|
Declare an interface named speaker with a method named speak. |
go/language/interfaces/exercises/template1
Declare an interface named speaker with a method named speak.
|
Declare an interface named speaker with a method named speak. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/language/methods/example3
Sample program to show how to declare function variables.
|
Sample program to show how to declare function variables. |
go/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. |
go/language/methods/exercises/exercise1
Declare a struct that represents a baseball player.
|
Declare a struct that represents a baseball player. |
go/language/methods/exercises/template1
Declare a struct that represents a baseball player.
|
Declare a struct that represents a baseball player. |
go/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. |
go/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. |
go/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. |
go/language/pointers/example4
Sample program to teach the mechanics of escape analysis.
|
Sample program to teach the mechanics of escape analysis. |
go/language/pointers/example5
Sample program to show how stacks grow/change.
|
Sample program to show how stacks grow/change. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/language/slices/example2
Sample program to show the components of a slice.
|
Sample program to show the components of a slice. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/language/slices/example8
Sample program to show how the for range has both value and pointer semantics.
|
Sample program to show how the for range has both value and pointer semantics. |
go/language/slices/exercises/exercise1
Declare a nil slice of integers.
|
Declare a nil slice of integers. |
go/language/slices/exercises/template1
Declare a nil slice of integers.
|
Declare a nil slice of integers. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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). |
go/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). |
go/language/variables/example1
Sample program to show how to declare variables.
|
Sample program to show how to declare variables. |
go/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. |
go/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. |
go/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. |
go/packages/context/example2
Sample program to show how to use the WithCancel function.
|
Sample program to show how to use the WithCancel function. |
go/packages/context/example3
Sample program to show how to use the WithDeadline function.
|
Sample program to show how to use the WithDeadline function. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/packages/io/advanced/example2
Sample program that adds a few more features.
|
Sample program that adds a few more features. |
go/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. |
go/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. |
go/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. |
go/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”. |
go/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. |
go/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. |
go/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. |
go/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. |
go/packages/logging/exercises/exercise1
Setup a new program to use the log package.
|
Setup a new program to use the log package. |
go/packages/logging/exercises/template1
Setup a new program to use the log package.
|
Setup a new program to use the log package. |
go/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. |
go/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. |
go/packages/reflection/inspect/integer
Example shows how to use reflection to decode an integer.
|
Example shows how to use reflection to decode an integer. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/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. |
go/profiling/godebug
Sample program that implements a simple web service that will allow us to explore how to use the GODEBUG variable.
|
Sample program that implements a simple web service that will allow us to explore how to use the GODEBUG variable. |
go/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. |
go/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. |
go/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”. |
go/profiling/pprof
Sample program that implements a simple web service that will allow us to explore how to use the http/pprof tooling.
|
Sample program that implements a simple web service that will allow us to explore how to use the http/pprof tooling. |
go/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. |
go/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. |
go/profiling/project/service
Package service maintains the logic for the web service.
|
Package service maintains the logic for the web service. |
go/profiling/stack_trace/example1
Sample program to show how to read a stack trace.
|
Sample program to show how to read a stack trace. |
go/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. |
go/profiling/stack_trace/example3
Sample program that implements a simple web service that will allow us to explore how to look at core dumps.
|
Sample program that implements a simple web service that will allow us to explore how to look at core dumps. |
go/profiling/trace
Sample program that performs a series of I/O related tasks to better understand tracing in Go.
|
Sample program that performs a series of I/O related tasks to better understand tracing in Go. |
go/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. |
go/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. |
go/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. |
go/testing/tests/example4
Sample program that implements a simple web service.
|
Sample program that implements a simple web service. |
go/testing/tests/example4/handlers
Package handlers provides the endpoints for the web service.
|
Package handlers provides the endpoints for the web service. |
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. |
web/apis/example1
Sample program to show how to create a simple web api with different versions.
|
Sample program to show how to create a simple web api with different versions. |
web/apis/example2
Sample program to show how to have a single route for the api but have access to either through configuration.
|
Sample program to show how to have a single route for the api but have access to either through configuration. |
web/apis/example3
Sample program to show how to create a basic CRUD based web api for customers.
|
Sample program to show how to create a basic CRUD based web api for customers. |
web/auth/example1
Sample program to show how to apply basic authentication with the standard library for your web request.
|
Sample program to show how to apply basic authentication with the standard library for your web request. |
web/auth/example2
Sample program to show how to apply basic authentication with the goth package for your web request.
|
Sample program to show how to apply basic authentication with the goth package for your web request. |
web/auth/example3
Sample program to show how to use JWTs
|
Sample program to show how to use JWTs |
web/basics/example1
Sample program to show how to create a handler for a basic web app.
|
Sample program to show how to create a handler for a basic web app. |
web/basics/example2
Sample program to show how to create handlers for different routes.
|
Sample program to show how to create handlers for different routes. |
web/basics/example3
Sample program to show how to create handlers for different routes utilizing the default mux.
|
Sample program to show how to create handlers for different routes utilizing the default mux. |
web/basics/example4
Sample program to show how to use methods as
|
Sample program to show how to use methods as |
web/basics/example5
Sample program to show how to create handlers out of any function using http.HandlerFunc.
|
Sample program to show how to create handlers out of any function using http.HandlerFunc. |
web/basics/example6
Sample program to show how http servers already handle concurrent requests.
|
Sample program to show how http servers already handle concurrent requests. |
web/consuming/example6
Sample program to how to use JWT for authentication.
|
Sample program to how to use JWT for authentication. |
web/consuming/exercises/exercise1
Call the GitHub API to get a list of repository contributors.
|
Call the GitHub API to get a list of repository contributors. |
web/consuming/exercises/template1
Call the GitHub API to get a list of repository contributors.
|
Call the GitHub API to get a list of repository contributors. |
web/middleware/example1
Sample program to show how to apply middleware.
|
Sample program to show how to apply middleware. |
web/middleware/example2
Sample program to show how to apply middleware using negroni.
|
Sample program to show how to apply middleware using negroni. |
web/middleware/example3
Sample program to show how to apply middleware using negroni.
|
Sample program to show how to apply middleware using negroni. |
web/middleware/example4
Sample program to show how to pass data between handlers using context.
|
Sample program to show how to pass data between handlers using context. |
web/muxers/example1
Sample program to show how to use the pat router.
|
Sample program to show how to use the pat router. |
web/muxers/example2
Sample program to show how to use the httprouter router.
|
Sample program to show how to use the httprouter router. |
web/muxers/example3
Sample program to show how to use the echo toolkit.
|
Sample program to show how to use the echo toolkit. |
web/posts/example1
Sample program to show how to handle different HTTP verbs.
|
Sample program to show how to handle different HTTP verbs. |
web/posts/example2
Sample program to show how to handle forms using a single handler for the GET and POST calls.
|
Sample program to show how to handle forms using a single handler for the GET and POST calls. |
web/posts/example3
Sample program to show how to decode forms into structs.
|
Sample program to show how to decode forms into structs. |
web/posts/example4
Sample program to show how to handle the uploading of file content in a request.
|
Sample program to show how to handle the uploading of file content in a request. |
web/rest/example1
Sample program to show how to use a regex to handle REST based URL schemas and routes.
|
Sample program to show how to use a regex to handle REST based URL schemas and routes. |
web/serializers/example1
Sample program to show how to encode and decode JSON.
|
Sample program to show how to encode and decode JSON. |
web/serializers/example2
Sample program to show how to control JSON encoding using struct tags.
|
Sample program to show how to control JSON encoding using struct tags. |
web/serializers/example3
Sample program to show how to implement the json.Marshaler interface to dictate the marshaling.
|
Sample program to show how to implement the json.Marshaler interface to dictate the marshaling. |
web/serializers/example4
Sample program to show common JSON mistakes.
|
Sample program to show common JSON mistakes. |
web/serializers/example5
Sample program that sends and receives JSON.
|
Sample program that sends and receives JSON. |
web/serializers/example6
Sample program to show how to use the XML encoder.
|
Sample program to show how to use the XML encoder. |
web/serializers/example7
Sample program to show how to implement the xml.Marshaler interface to dictate the marshaling.
|
Sample program to show how to implement the xml.Marshaler interface to dictate the marshaling. |
web/sessions_cookies/example1
Sample program to show how to use sessions in your web app.
|
Sample program to show how to use sessions in your web app. |
web/sessions_cookies/example2
Sample program to show how to use a cookie in your web app.
|
Sample program to show how to use a cookie in your web app. |
web/shutdown/example1
This program shows how to launch a web server then shut it down gracefully.
|
This program shows how to launch a web server then shut it down gracefully. |
web/sockets/example1
Sample program on how to use the Google web socket package to bind HTTP requests.
|
Sample program on how to use the Google web socket package to bind HTTP requests. |
web/sockets/example2
Sample program on how to use the Gorilla web socket package to bind HTTP requests.
|
Sample program on how to use the Gorilla web socket package to bind HTTP requests. |
web/templates/example1
Sample program to show how to use create, parse and execute a simple template.
|
Sample program to show how to use create, parse and execute a simple template. |
web/templates/example2
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
web/templates/example3
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
web/templates/example4
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
web/templates/example5
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
web/templates/example6
Sample program to show how to use create, parse and execute a template with simple data processing.
|
Sample program to show how to use create, parse and execute a template with simple data processing. |
web/templates/example7
Sample program to show how to serve up static files from a web application and deliver a home page.
|
Sample program to show how to serve up static files from a web application and deliver a home page. |
web/templates/example8
Sample program to show how to bundle assets, static files, etc into web application and access these bundled resources.
|
Sample program to show how to bundle assets, static files, etc into web application and access these bundled resources. |
web/tls/example1
Sample program to show how to launch a server that uses TLS.
|
Sample program to show how to launch a server that uses TLS. |
web/tls/example2
Sample program to show how to launch a server with automatic TLS using ACME via LetsEncrypt.
|
Sample program to show how to launch a server with automatic TLS using ACME via LetsEncrypt. |
Click to show internal directories.
Click to hide internal directories.