golang_gotchas

module
v0.0.0-...-e2a1867 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2024 License: MIT

README

golang gotchas

Anything I didn't know about golang and is somehow special to golang for me with programming background in Java, Python, Groovy, C, C++ and misc other programming languages

Maybe it helps others starting to use golang :-)

  1. acceptLanguage - Sample using golang.org/x/text/language to select the correct language from HTTP Accept-Language
  2. broadcastChan - Sample how to implement simple broadcasts
  3. compareMaps -Typical pitfall when comparing map elements
  4. copyStructs - Sample code using github.com/jinzhu/copier to copy structs
  5. debugHTTPClient - Sample code which uses httputil to get low level debugging of http clients
  6. errorMarshaling - Sample code hoe marshaling of errors works
  7. fetchUrls - Use gofuncs to execute get requests against a number of urls and calculate responsetime statistics
  8. github - Retrieve all public repositories of a github organization with a home grown client or a client using the google go-github library
  9. gorohttp - Simple sample code how to kick off http requests as fast as possible
  10. httpStress - More complex sample code how to kick off http requests as fast as possible
  11. httpClient - Sample how to use timeouts in a httpClient
  12. i18n - Sample code using github.com/nicksnyder/go-i18n/i18n to enable localization
  13. jsonMarshalling - Print the different marshal/unmarshal results of different structures into/from JSON
  14. logging - Sample code using go.uber.org/zap to create structured logs and use log hooks
  15. pointers - Sample code to demonstrate a common error using pointers in golang when you are used to use C or C++
  16. pollURLs - Golang pollURL sample code
  17. sigTerm - Catch SIGTERM or SIGINT to gracefully shutdown program
  18. templates - Sample code using golang /text/template
  19. utils
    1. json.go - pretty print JSON
  20. waitGroupTimeout - Sample which implements a waitGroup which can timeout

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL