The LearnGo project includes various Go basics as well as some patterns and examples.
When I started to explore Go, I wanted to have something to refer back to and have some examples I can use. I would keep finding things on the web, but soon forgot about them and had to find them again. As a result, I started to just compile various examples I found useful. I figured I'd share some of these examples in hopes that they could be useful to someone. However, take them with a grain of salt since I'm by no means a Go expert and still feel very much like a newb.
Basics includes basic Go examples. It starts with the most basic things like variables and goes deeper including below learning modules. Each module includes various examples.
- Variables
- Printing
- Flow Control
- Loops
- Arrays
- Types
- Enums
- Slices
- Maps
- Functions
- Closures
- Structs
- Composition and Embedding
- Methods
- Pointers
- Constructors
- Errors
- Concurrency
- Packages
- Variadic Params
- Dates
- Recursion
- Interface
This includes various patterns and examples of common things and how to solve them in Go.
- Gorm and SQLite
- Gorm and Postgres
- Mongodb using mgo and mongo driver
- Docker
- JSON
- Logging
- Rate Limiting
- Tickers
- Testing
- User Input
- UUID
- Http Get
- Web Servers
- gRPC
- oAuth to Google
To run these examples locally, just clone them in your GOPATH using:
git clone https://github.com/vcollak/learnGo