With the high adoption of the Go language by developers and large companies, this has led companies to search for engineers with experience in Go.
This can create a lot of pressure of what to study to become a better engineer, this is very personal, it requires planning of what and when to study other subjects (even outside the engineering area).
In this blogpost some topics (with repositories and links) that I think are important to know in order to become an engineer person with even better Go knowledge, follow good practices for writing code, concepts of code structure (usually using design pattern), scalable code and clean code.
Style guide
I can't list only one link (repository) for this topic, I would recommend you to read for these 3 links and bring to your team's day to day life what best fits their reality — remember to use as base the official language documentation and add what makes sense from the other links
This repository holds the Uber Go Style Guide, which documents patterns and conventions used in Go code at Uber.
Style Guide
See Uber Go Style Guide for the style guide.
Translations
We are aware of the following translations of this guide by the Go community.
- 中文翻译 (Chinese): xxjwxc/uber_go_guide_cn
- 繁體中文 (Traditional Chinese):ianchen0119/uber_go_guide_tw
- 한국어 번역 (Korean): TangoEnSkai/uber-go-style-guide-kr
- 日本語訳 (Japanese): knsh14/uber-style-guide-ja
- Traducción al Español (Spanish): friendsofgo/uber-go-guide-es
- แปลภาษาไทย (Thai): pallat/uber-go-style-guide-th
- Tradução em português (Portuguese): lucassscaravelli/uber-go-guide-pt
- Tradução em português (Portuguese BR): alcir-junior-caju/uber-go-style-guide-pt-br
- Tłumaczenie polskie (Polish): DamianSkrzypczak/uber-go-guide-pl
- Русский перевод (Russian): sau00/uber-go-guide-ru
- Français (French): rm3l/uber-go-style-guide-fr
- Türkçe (Turkish): ksckaan1/uber-go-style-guide-tr
- Український переклад (Ukrainian): vorobeyme/uber-go-style-guide-uk
- ترجمه فارسی (Persian): jamalkaksouri/uber-go-guide-ir
- Tiếng việt (Vietnamese): nc-minh/uber-go-guide-vi
If you have a translation, feel free to submit a PR adding it to the list.
Go standards and style guidelines | GitLab
Best Practices
Francesc Campoy gave an excellent talk at OSCON 2015 on this subject, where he covered best practices for developing software using the Go language.
Slides
Algorithms Implemented
TheAlgorithms / Go
Algorithms and Data Structures implemented in Go for beginners, following best practices.
The Algorithms - Go
Algorithms implemented in Go (for education)
The repository is a collection of open-source implementation of a variety of algorithms implemented in Go and licensed under MIT License.
Read our Contribution Guidelines before you contribute.
List of Algorithms
Packages:
ahocorasick
Functions:
-
Advanced
: Advanced Function performing the Advanced Aho-Corasick algorithm. Finds and prints occurrences of each pattern. -
AhoCorasick
: AhoCorasick Function performing the Basic Aho-Corasick algorithm. Finds and prints occurrences of each pattern. -
ArrayUnion
: ArrayUnion Concats two arrays of int's into one. -
BoolArrayCapUp
: BoolArrayCapUp Dynamically increases an array size of bool's by 1. -
BuildAc
: Functions that builds Aho Corasick automaton. -
BuildExtendedAc
: BuildExtendedAc Functions that builds extended Aho Corasick automaton. -
ComputeAlphabet
: ComputeAlphabet Function that returns string of all the possible characters in given patterns. -
ConstructTrie
: ConstructTrie Function that constructs Trie as an automaton for a set of reversed & trimmed strings. - …
This repository contains Go based examples of many popular algorithms and data structures.
Each algorithm and data structure has its own separate README with related explanations and links for further reading.
Clean Code
A reference for the Go community that covers the fundamentals of writing clean code and discusses concrete refactoring examples specific to Go.
Pungyeon / clean-go-article
A reference for the Go community that covers the fundamentals of writing clean code and discusses concrete refactoring examples specific to Go.
Clean Go Code
Preface: Why Write Clean Code?
This document is a reference for the Go community that aims to help developers write cleaner code. Whether you're working on a personal project or as part of a larger team, writing clean code is an important skill to have. Establishing good paradigms and consistent, accessible standards for writing clean code can help prevent developers from wasting many meaningless hours on trying to understand their own (or others') work.
We don’t read code, we decode it – Peter Seibel
As developers, we're sometimes tempted to write code in a way that's convenient for the time being without regard for best practices; this makes code reviews and testing more difficult. In a sense, we're encoding—and, in doing so, making it more difficult for others to decode our work. But we want our code to be usable, readable, and maintainable. And that requires…
Clean Architecture
In his book “Clean Architecture: A Craftsman’s Guide to Software Structure and Design” famous author Robert “Uncle Bob” Martin presents an architecture with some important points like testability and independence of frameworks, databases and interfaces.
bxcodec / go-clean-arch
Go (Golang) Clean Architecture based on Reading Uncle Bob's Clean Architecture
go-clean-arch
Changelog
-
v1: checkout to the v1 branch
Proposed on 2017, archived to v1 branch on 2018
Desc: Initial proposal by me. The story can be read here: https://medium.com/@imantumorang/golang-clean-archithecture-efd6d7c43047 -
v2: checkout to the v2 branch
Proposed on 2018, archived to v2 branch on 2020
Desc: Improvement from v1. The story can be read here: https://medium.com/@imantumorang/trying-clean-architecture-on-golang-2-44d615bf8fdf -
v3: checkout to the v3 branch
Proposed on 2019, merged to master on 2020.
Desc: Introducing Domain package, the details can be seen on this PR #21 -
v4: master branch Proposed on 2024, merged to master on 2024.
Desc:- Declare Interfaces to the consuming side,
- Introduce
internal
package - Introduce
Service-focused
package.
Details can be seen in this PR #88.
Author's Note
You may notice it diverges from the structures seen in previous versions. I encourage you to explore the branches for each version to select the structure that appeals to…
Elton Minetto has written two excellent blogposts on the subject:
Awesome Go
I couldn't leave out the awesome-go project (which I started in 2014 and today many contributors help me maintain)
avelino / awesome-go
A curated list of awesome Go frameworks, libraries and software
Awesome Go
We use the Golang Bridge community Slack for instant communication, follow the form here to join.
Sponsorships:
Special thanks to
Awesome Go has no monthly fee, but we have employees who work hard to keep it running. With money raised, we can repay the effort of each person involved! You can see how we calculate our billing and distribution as it is open to the entire community. Want to be a supporter of the project click here.
A curated list of awesome Go frameworks, libraries, and software. Inspired by awesome-python.
Contributing:
…
A collection of awesome Go libraries and resources. This repository contains a list of variety of frameworks, template engines, articles and post, documentations, reactive and functional programming and much more which will increase your resourcefulness and might also help you to choose the tech stack for your next projects.
Project Guideline
This is a complicated subject, there is no standard that will work perfectly for what you are developing, I recommend understanding the concept of project architecture (not only Go) and together with your team understand what works for you, even though there are thousands of books to give you knowledge about the subject I recommend putting your hands in the code and allow you to make mistakes, it is the best way to evolve.
Read this content before any other
Now that you have read the previous link I will recommend a controversial repository by its name, it is not "Golang standards project layout", but there is a project structure that can help in the development of a new project - understand what makes sense for you (and your team), what doesn't, just ignore it.
golang-standards / project-layout
Standard Go Project Layout
Standard Go Project Layout
Translations:
- 한국어 문서
- 简体中文
- 正體中文
- 简体中文 - ???
- Français
- 日本語
- Português
- Español
- Română
- Русский
- Türkçe
- Italiano
- Vietnamese
- Українська
- Indonesian
- हिन्दी
Overview
This is a basic layout for Go application projects. Note that it's basic in terms of content because it's focusing only on the general layout and not what you have inside. It's also basic because it's very high level and it doesn't go into great details in terms of how you can structure your project even further. For example, it doesn't try to cover the project structure you'd have with something like Clean Architecture.
This is NOT an official standard defined by the core Go dev team
. This is a set of common historical and emerging project layout patterns in the Go ecosystem. Some of these patterns are more popular than others. It also has a number of small enhancements along with several supporting…
Vote Of Thanks
Thank you so much for reading this post and I hope you find these repositories as useful as I do and will help you to become better go developer. Feel Free to give any suggestions and if you like my work you can follow me on Twitter
Top comments (2)
Great resources!! Thank you a lot :)
Great resources thanks - I've bookmarked most of them and made them public on Codever - "go"