training icon indicating copy to clipboard operation
training copied to clipboard

Learning Golang one day

Golang Training

Build Status Run Tests

Learning basic Golang in one day

Example code

  • example01: Show hello world. Try to use golint and gofmt tool.
  • example02: Let's write a library and use it from the hello program.
  • example03: How to use if, switch and const in Go.
  • example04: How to initializing constructor in Go.
  • example05: Create interface for multiple struct.
  • example06: How to use Goroutines in Go, share by communicating.
  • example07: Errors handler in Go.
  • example08: A type assertion provides access to an interface value.
  • example09: Write command line tool in Go.
  • example10: Simple http server and show example using gin framework.
  • example11: Learn go build constraints.
  • example12: Building minimal docker containers for go application.
  • example13: Sharing Golang packages to C and Go.
  • example14: How to use func in go?
  • example15: How to pass slice as function arguments?
  • example16: What is init function in Go?
  • example17: How to handle json in Go?
  • example18: How to write testingin Go?
  • example19: Deploy golang app using drone + kubernetes.
  • example20: write simple benchmark.
  • exmaple21: Simple https-tls server example using mkcert.
  • exmaple22: How to use go module in go version 1.11.
  • example23: Deploy go application useing apex/up tool.
  • example24: Debug golang code in vscode using dlv.
  • example25: Running golang app using traefik & Let's Encrypt & Docker.
  • example27: How to loads environment variables from .env.
  • example28: Go webserver with gracefull shutdown.
  • example29: How to handle multiple Go channel?
  • example30: Simplest Way to Handle Timeouts?
  • example31: How to implements a simple job queue? Youtube
  • example32: four tips with select in golang.
  • example33: share memory by communicating.
  • example34: graceful shutdown with multiple workers.
  • example35: introduction to context package.
  • example36: performance result with differnet concat string method.
  • example38: concurrency is still not easy. English Blog, Chinese Blog
  • example39: select random channel value?
  • example40: go 1.16 support Embedding Files, Chinese Blog
  • example41 why use buffered channel signal? Chinese Blog
  • example42 Please use three goroutines to run 10 times each, and output cat, dog, bird in order
  • example43 graceful shutdown with progress bar. Chinese Blog
  • example44 graceful stop service using docker-compose. Chinese Blog
  • example45 introduction to go1.18 generics. Chinese Blog
  • example46 introduction to go1.18 generics constraints, slices and maps packages. Chinese Blog
  • example47 pyroscope adhoc profiling in go. Chinese Blog
  • example48 simple pub/sub pattern in go. Chinese Blog