Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamal-github/286d66b941d26c82abb7cbbdfe4c4d5f to your computer and use it in GitHub Desktop.
Save kamal-github/286d66b941d26c82abb7cbbdfe4c4d5f to your computer and use it in GitHub Desktop.

Main/Summary points of Go for Industrial Programming, Video

  • Do not decide your project Structure at the very end, it evolves!
  • Make configuration based sysytem, and flags are the best way to change the behaviour of your syetem function.
  • Manage goroutines lifecycle, thy are prone to leak, Always think of how this gorouting will finish/interrupt. Always try to pass some sort of interrupt func/context to interrupt e.g. func foo(execFunc func(...args interface{}) error, interupptFunc func() error) or listening to context.Done
  • Use interface at the consumer side not at the implementation package, interfaces are really good to mock the dependencies.
  • Must watch, Advanced Testing with go
  • Do not misuse context, make context Value only request scoped like request ID for DT or auth data. the rule of thumb is if data is available before request start, pass it as normal func arg
  • The Component Graph, Keep the dependencies structured and expressive, do not use any magical things like containers for DI.

Credits - Peter Bourgon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment