https://github.com/devdrops/go-gotchas
27 desafios em Go
https://github.com/devdrops/go-gotchas
Last synced: about 2 months ago
JSON representation
27 desafios em Go
- Host: GitHub
- URL: https://github.com/devdrops/go-gotchas
- Owner: devdrops
- Created: 2021-11-17T21:30:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-19T18:53:18.000Z (about 3 years ago)
- Last Synced: 2025-04-20T18:38:51.120Z (2 months ago)
- Language: Go
- Size: 21.5 KB
- Stars: 24
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Gotchas
[Go Gotchas](https://yourbasic.org/golang/gotcha/) é uma série de 27 desafios na
linguagem Go, propostos para melhoria do código que escrevemos no dia a dia.## Lista de Todos os Desafios
1. :white_check_mark: [Assignment to entry in nil map](https://yourbasic.org/golang/gotcha-assignment-entry-nil-map/)
2. :white_check_mark: [Invalid memory address or nil pointer dereference](https://yourbasic.org/golang/gotcha-nil-pointer-dereference/)
3. :white_check_mark: [Multiple-value in single-value context](https://yourbasic.org/golang/gotcha-multiple-value-single-value-context/)
4. :white_check_mark: [Array won't change](https://yourbasic.org/golang/gotcha-function-doesnt-change-array/)
5. :white_check_mark: [Shadowed variables](https://yourbasic.org/golang/gotcha-shadowing-variables/)
6. :white_check_mark: [Unexpected newline](https://yourbasic.org/golang/gotcha-missing-comma-slice-array-map-literal/)
7. :white_check_mark: [Immutable strings](https://yourbasic.org/golang/gotcha-strings-are-immutable/)
8. :white_check_mark: [How does characters add up?](https://yourbasic.org/golang/gotcha-concatenate-rune-string/)
9. :white_check_mark: [What happened to ABBA?](https://yourbasic.org/golang/gotcha-trim-string/)
10. :white_check_mark: [Where is my copy?](https://yourbasic.org/golang/gotcha-copy-missing/)
11. :white_check_mark: [Why doesn't append work every time? (scary bug)](https://yourbasic.org/golang/gotcha-append/)
12. :white_check_mark: [Constant overflows int](https://yourbasic.org/golang/gotcha-constant-overflows-int/)
13. :white_check_mark: [Unexpected ++, expecting expression](https://yourbasic.org/golang/gotcha-increment-decrement-statement/)
14. [Get your priorities right](https://yourbasic.org/golang/gotcha-operator-precedence/)
15. [Go and Pythagoras](https://yourbasic.org/golang/gotcha-bitwise-operators/)
16. [No end in sight](https://yourbasic.org/golang/gotcha-integer-overflow-wrap-around/)
17. [Numbers that starts with zero](https://yourbasic.org/golang/gotcha-octal-decimal-hexadecimal-literal/)
18. [Whatever remains](https://yourbasic.org/golang/gotcha-remainder-modulo-operator/)
19. [Time is not a number](https://yourbasic.org/golang/gotcha-multiply-duration-integer/)
20. [Index out of range](https://yourbasic.org/golang/gotcha-index-out-of-range/)
21. [Unexpected values in range loop](https://yourbasic.org/golang/gotcha-unexpected-values-range/)
22. [Can't change entries in range loop](https://yourbasic.org/golang/gotcha-change-value-range/)
23. [Iteration variable doesn't see change in range loop](https://yourbasic.org/golang/gotcha-range-copy-array/)
24. [Iteration variables and closures](https://yourbasic.org/golang/gotcha-data-race-closure/)
25. [No JSON in sight](https://yourbasic.org/golang/gotcha-json-marshal-empty/)
26. [Is "three" a digit?](https://yourbasic.org/golang/gotcha-regexp-substring/)
27. [Nil is not nil](https://yourbasic.org/golang/gotcha-why-nil-error-not-equal-nil/)A solução que fiz para cada desafio está dentro de uma pasta neste repositório.
## Observações
Alguns dos desafios propostos foram alterados, corrigidos e/ou modificados desde
a criação dessa lista. Sempre que possível, procuro o
[autor do texto](https://twitter.com/yourbasic_org) para apontar quando encontro
isso, e com qual versão de Go isso pode ter sido corrigido. Segue abaixo uma
lista: