Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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
You can’t perform that action at this time.