Save 37% off PRO during our Black Friday Sale! »

A beleza das interfaces em Go

A beleza das interfaces em Go

B30885a14060cbd33cadaabbc44ca688?s=128

pcasarettto

July 09, 2016
Tweet

Transcript

  1. A beleza das interfaces em Go

  2. Paulo Casaretto @pcasaretto

  3. Interface

  4. Interfaces em Go

  5. None
  6. None
  7. None
  8. io.Reader io.Writer

  9. io.Copy io.Reader io.Writer

  10. Reader Example: GIF Decoder

  11. os.File deblockingReader lzw.Reader

  12. os.File | deblockingReader | lzw.Reader

  13. os.File deblockingReader lzw.Reader io.Reader

  14. Usando interfaces

  15. None
  16. None
  17. None
  18. None
  19. Two relevant Go proverbs

  20. THE BIGGER THE INTERFACE, THE WEAKER THE ABSTRACTION

  21. interface{} says nothing

  22. ProTip

  23. • https://blog.golang.org/error-handling-and-go • https://blog.golang.org/errors-are-values • https://blog.golang.org/gif-decoder-exercise- in-go-interfaces • https://go-proverbs.github.io/ Resources

  24. Thanks!

  25. panic(“Thanks!”)

  26. None
  27. None
  28. None