├── LICENSE ├── README.md ├── docs ├── README.md ├── best_practices.md ├── code_style.md ├── directory_structure.md ├── packages.md ├── projects.md ├── reading_list.md └── tools.md └── mkdocs.yml /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 HelloFresh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HelloFresh - Golang Guides 2 | 3 | Welcome to HelloFresh guides for Go projects and developers. 4 | 5 | - [Best Practices](docs/best_practices.md) 6 | - [Code Style](docs/code_style.md) 7 | - [Directory Structure](docs/directory_structure.md) 8 | - [Packages](docs/packages.md) 9 | - [Projects](docs/projects.md) 10 | - [Reading List](docs/reading_list.md) 11 | - [Tools](docs/tools.md) 12 | 13 | ## Contributing 14 | 15 | Use common sense and Pull Requests for the win, and may the --force be with you! 16 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # HelloFresh - Golang Guides 2 | 3 | Welcome to HelloFresh guides for Go projects and developers. 4 | 5 | - [Best Practices](best_practices.md) 6 | - [Code Style](code_style.md) 7 | - [Directory Structure](directory_structure.md) 8 | - [Packages](packages.md) 9 | - [Projects](projects.md) 10 | - [Reading List](reading_list.md) 11 | - [Tools](tools.md) 12 | 13 | ## Contributing 14 | 15 | Use common sense and Pull Requests for the win, and may the --force be with you! 16 | -------------------------------------------------------------------------------- /docs/best_practices.md: -------------------------------------------------------------------------------- 1 | # Best Practices 2 | 3 | Common tips, patterns, do's and dont's for Go projects at HelloFresh. 4 | -------------------------------------------------------------------------------- /docs/code_style.md: -------------------------------------------------------------------------------- 1 | # Code Style 2 | 3 | Unfortunately there is no official Code Style Guide by the Go team, although there is certainly a solid convention on code style that is enforced by `go fmt` and a few other tools. 4 | 5 | Two resources that will help you to start writing Go in style include: 6 | 7 | 1. [Effective Go](https://golang.org/doc/effective_go.html) 8 | 2. [Go Wiki](https://github.com/golang/go/wiki/CodeReviewComments) 9 | -------------------------------------------------------------------------------- /docs/directory_structure.md: -------------------------------------------------------------------------------- 1 | # Directory structure 2 | 3 | Recommended structure of files and directories for HelloFresh Go projects 4 | 5 | ## Skeleton project 6 | 7 | https://github.com/thockin/go-build-template can be used as an example project template. 8 | -------------------------------------------------------------------------------- /docs/packages.md: -------------------------------------------------------------------------------- 1 | # Packages 2 | 3 | This page contains packages recommended by HelloFresh Golang Clan. These are not just the cool repos around, but the packages that we found really practical and worth to use over the others. 4 | 5 | If you need more packages or just for inspiration, visit [Awesome Go](https://awesome-go.com/). 6 | 7 | ## CLI 8 | 9 | - [github.com/spf13/cobra](https://github.com/spf13/cobra) - solution for CLI interface implementation 10 | 11 | ## Configuration 12 | 13 | - [github.com/kelseyhightower/envconfig](https://github.com/kelseyhightower/envconfig) - get configs from environment variables 14 | - [github.com/spf13/viper](https://github.com/spf13/viper) - configuration solution 15 | 16 | ## Database 17 | 18 | - [database/sql](https://golang.org/pkg/database/sql/) - standard SQL library that you should stick to or build upon 19 | - [github.com/jmoiron/sqlx](https://github.com/jmoiron/sqlx) - extension to standard SQL library that makes it a bit more convenient 20 | - [github.com/mattes/migrate](https://github.com/mattes/migrate) - database migrations 21 | 22 | ## Encoding 23 | 24 | - [github.com/gorilla/schema](https://github.com/gorilla/schema) - decode forms and URL query string into Go structs and vice versa 25 | 26 | ## HTTP 27 | 28 | - [github.com/go-chi/chi](https://github.com/go-chi/chi) - router with decent performance and middleware support 29 | - [github.com/dgrijalva/jwt-go](https://github.com/dgrijalva/jwt-go) - JSON Web Token library 30 | - [github.com/hellofresh/health-go](https://github.com/hellofresh/health-go) - adds health status check endpoints to your app 31 | - [github.com/rafaeljesus/retry-go](https://github.com/rafaeljesus/retry-go) - retry mechanism to build into your HTTP clients 32 | - [github.com/sony/gobreaker](https://github.com/sony/gobreaker) - CircuitBreaker implementation, use this in your HTTP clients 33 | 34 | 35 | ## Logging and Metrics 36 | 37 | - [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) - logging package 38 | - [go.uber.org/zap](https://github.com/uber-go/zap) - alternative logging package 39 | - [github.com/opentracing/opentracing-go](https://github.com/opentracing/opentracing-go) - tracing library (e.g. for tracing requests, etc.) 40 | - [github.com/hellofresh/gcloud-opentracing](https://github.com/hellofresh/gcloud-opentracing) - GCloud StackDriver tracer for OpenTracing-Go 41 | 42 | ## Testing 43 | 44 | - [github.com/DATA-DOG/godog](https://github.com/DATA-DOG/godog) - Cucumber-style BDD testing 45 | - [github.com/stretchr/testify](https://github.com/stretchr/testify) - makes assertions and mocking more convenient 46 | 47 | ## Validation 48 | 49 | - [github.com/asaskevich/govalidator](https://github.com/asaskevich/govalidator) - validation package that uses struct tag annotations 50 | -------------------------------------------------------------------------------- /docs/projects.md: -------------------------------------------------------------------------------- 1 | # Projects 2 | 3 | Existing projects in Go that can be used as examples. 4 | 5 | ## HelloFresh 6 | 7 | This is a public repo and we cannot post links to internal projects here. But if you are in HelloFresh GitHub organization, just search for `awesome-go` to find them. 8 | 9 | ## Third party 10 | - https://github.com/ardanlabs/service -------------------------------------------------------------------------------- /docs/reading_list.md: -------------------------------------------------------------------------------- 1 | # Hellofresh - Golang Reading List 2 | 3 | Welcome to our golang reading list. If you are new to golang we recommend going through our getting started links. 4 | 5 | ## Getting Started 6 | - https://golangbot.com/learn-golang-series/, great concise and complete series about the language 7 | - https://www.golang-book.com/books/intro 8 | - https://tour.golang.org/welcome/1 9 | - https://golang.org/doc/ 10 | - https://golang.org/doc/effective_go.html 11 | - https://github.com/golang/go/wiki 12 | 13 | ## Tips 14 | - https://gobyexample.com/ 15 | 16 | ## Advanced Topics 17 | - http://peter.bourgon.org/go-best-practices-2016/ 18 | - https://divan.github.io/posts/avoid_gotchas/ 19 | - https://medium.com/@Martynas/formatting-date-and-time-in-golang-5816112bf098 20 | 21 | ## Books 22 | - https://www.safaribooksonline.com/library/view/the-go-programming/9780134190570/ 23 | - https://www.safaribooksonline.com/library/view/go-programming-blueprints/9781786468949/ 24 | - https://www.safaribooksonline.com/library/view/go-in-action/9781617291784/ 25 | - https://www.safaribooksonline.com/library/view/go-in-practice/9781633430075/ 26 | 27 | ## Talks / Videos 28 | - https://www.youtube.com/playlist?list=PL64wiCrrxh4Jisi7OcCJIUpguV_f5jGnZ (Just for func by Francesc Campoy) 29 | - https://www.udemy.com/learn-how-to-code Go for beginners by Todd McLeod (Paid) 30 | - https://www.udemy.com/go-programming-language/ Web Development with Go by Todd McLeod (Paid) 31 | - https://www.youtube.com/user/toddmcleod 32 | - https://www.safaribooksonline.com/library/view/introducing-go/9781491941997/ Introducing Go 33 | - https://www.safaribooksonline.com/library/view/oscon-2016-/9781491958476/video284945.html (Building Amazing cross-platform command-lines apps in Go Part 1 by Steve Francia and Ashley McNamara) 34 | - https://www.safaribooksonline.com/library/view/oscon-2016-/9781491958476/video284946.html (Building Amazing cross-platform command-lines apps in Go Part 2 by Steve Francia and Ashley McNamara) 35 | - https://www.infoq.com/presentations/go-concurrency-gc Historical context around the technical decisions of the Go language to better understand its concurrency primitives, garbage collection, and small standard library. 36 | - https://www.infoq.com/presentations/bank-go Why Go is suited for a microservices architecture, the language features that make it particularly attractive to high volume, low latency, distributed applications, and how easy it is to adopt into existing systems and organisations. 37 | - https://www.infoq.com/presentations/go-iron-production Travis Reeder thinks performance, memory, concurrency, reliability, and deployment are key to exploring Go and its value in production. Travis describes how it’s worked for Iron.io. 38 | - https://www.safaribooksonline.com/library/view/ultimate-go-programming/9780134757476/ 15+ hours of video instruction by Bill Kennedy (Paid) 39 | 40 | ## Blogs 41 | - https://www.goinggo.net/ (Bill Kennedy) 42 | - https://dave.cheney.net/ 43 | 44 | ## Podcasts 45 | - https://changelog.com/gotime 46 | -------------------------------------------------------------------------------- /docs/tools.md: -------------------------------------------------------------------------------- 1 | # Tools 2 | 3 | Recommended tools for development 4 | 5 | - [dep](https://golang.github.io/dep/) - our dependency management tool of choice 6 | - [Glide](https://glide.sh/) - our secondary dependency nanagement tool of choice 7 | - [goimports](https://github.com/bradfitz/goimports) - sorts `import` section of your `.go` files according to recomendations 8 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: 'Go reading list' 2 | site_description: 'HelloFresh guides for Go projects and developers' 3 | 4 | plugins: 5 | - techdocs-core 6 | 7 | markdown_extensions: 8 | - admonition 9 | 10 | nav: 11 | - Home: 'docs/README.md' 12 | - Best Practices: 'docs/best_practices.md' 13 | - Code Style: 'docs/code_style.md' 14 | - Directory Structure: 'docs/directory_structure.md' 15 | - Packages: 'docs/packages.md' 16 | - Projects: 'docs/projects.md' 17 | - Reading List: 'docs/reading_list.md' 18 | - Tools: 'docs/tools.md' 19 | --------------------------------------------------------------------------------