Skip to content

🚦 Go Playground for experimenting with Go 🐿 - the language features. 💻

Notifications You must be signed in to change notification settings

ross-humphrey/go-playground

Repository files navigation

GO Playground

What is this project?

This project is a collection of go files that demonstrate different features of the language. The files are copied from a number of different code examples (see reference section), these are used to help enhance my own learning of the Go language.

How to run these go applications?

Download the source, in the directory the particular files are stored. Run the following:

go run <file_name.go>

How to build these go applications?

Download the source, in the directory the particular files are stored. Run the following:

go build <file_name.go>

How do I run tests

Navigate to a directory with tests and run: 'go test' or for verbose logging: 'go test -v'

References

This project is a collection of different code snippets from a bunch of different sites.

https://gobyexample.com/ https://dev.to/deepu105/7-easy-functional-programming-techniques-in-go-3idp https://blog.alexellis.io/golang-writing-unit-tests/ https://www.ru-rocker.com/2017/07/10/how-to-unit-test-and-mocking-a-function-in-go/

List of topics covered:

Hello World

Values

Variables

Constants

For

If/Else

Switch

Arrays

Slices

Maps

Range

Functions

Multiple Return Values

Variadic Functions

Closures

Recursion

Pointers

Structs

Methods

Interfaces

Errors

Goroutines

Channels

Channel Buffering

Channel Synchronization

Channel Directions

Select

Timeouts

Non-Blocking Channel Operations

Closing Channels

Range over Channels

Timers

Tickers

Worker Pools

WaitGroups

Rate Limiting

Atomic Counters

Mutexes

Stateful Goroutines

Sorting

Sorting by Functions

Panic

Defer

Collection Functions

String Functions

String Formatting

Regular Expressions

JSON

XML

Time

Epoch

Time Formatting / Parsing

Random Numbers

Number Parsing

URL Parsing

SHA1 Hashes

Base64 Encoding

Reading Files

Writing Files

Line Filters

File Paths

Directories

Temporary Files and Directories

Testing

Command-Line Arguments

Command-Line Flags

Command-Line Subcommands

Environment Variables

HTTP Clients

HTTP Servers

Spawning Processes

Exec'ing Processes

Signals

Exit

About

🚦 Go Playground for experimenting with Go 🐿 - the language features. 💻

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages