/golang-tuts

Golang tutorial

Primary LanguageGo

Golang tutorial: This content is for Training Golang:

If you are interested in training contact mohittalniya@gmail.com

Day 1:

  1. Variable declaration
  2. Constants
  3. Derived Data types with type keyword
  4. Enums
  5. Struct and member fields and methods
  6. DuckTyping with Interfaces

Day 2:

Assignment:

main :

  1. Create an hrm struct -- employee package
  2. Employee you pass it will return employee of that type: Factory Pattern with 3 structs we created.

call constructors of 3 structs. and call getDetails for all 3.

https://gobyexample.com/switch

https://yourbasic.org/golang/type-assertion-switch/

Day 3:

  1. Array and Slices
  2. Map in golang
  3. for...range
  4. make keyword

Day 4:

  1. goroutines
  2. channels
  3. buffered and unbuffered
  4. communication using channels
  5. Arrow operator to transfer data

assignment

  • pipeline pattern using goroutines
  • create a producer thread - write some values to a channel-1 say 1- 50
  • create a consumer-1 thread -- consume the values from channel-1 , produce square of those values - put it into new channel-2
  • create a consumer-2 thread -- this prints the squared value form the channel-2

Day 5:

  1. Worker Pool using go routine
  2. sync package wait group and mutexes

Day 6:

  1. Functional programming - Function is the first class citizen

Day 7:

  1. Select operation
  2. Anonymous function and closures

Assignment

/// Read from One channel and write it into multiple channel /// // 1 2 3 4 5 6 -> ch1 /// bottleneck /// 1 3 4-> ch2 4 5 6 -> ch3

Day 8:

  1. Decorator for functions
  2. Simple state machine implementation

Day 9:

  1. HTTP server using golang
  2. Gorilla mux for route creation
  3. REST documentation using go-swagger
  4. https://golang.org/doc/articles/wiki/

Day 10:

  1. Structuring projects in golang - https://github.com/golang-standards/project-layout
  2. creating Microservices
  3. creating local K8s cluster- https://kind.sigs.k8s.io/docs/user/quick-start/
  4. Logging using zap

Day 12:

  1. Microservices-1 : https://github.com/SuperMohit/crypto-coins

Day 11:

  1. Asynchronous communication with RabbitMQ
  2. Introducing MongoDB

Day 12:

  1. gRPC based communication using protobuf https://netflixtechblog.com/practical-api-design-at-netflix-part-1-using-protobuf-fieldmask-35cfdc606518

Linters enabled in the IDE:

Day 14:

https://kubernetes.io/blog/2018/07/09/ipvs-based-in-cluster-load-balancing-deep-dive/ https://github.com/natefinch/lumberjack https://github.com/bitnami-labs/sealed-secrets https://pkg.go.dev/embed https://go.dev/blog/generics-proposal https://pkg.go.dev/reflect