Golang Open Source Projects to Contribute and Learn From

Author

Reads 1.2K

Business professional at the desk examining a software development agreement document.
Credit: pexels.com, Business professional at the desk examining a software development agreement document.

Contributing to open source projects is a great way to learn and gain experience with Golang. The Go project itself is open source, with thousands of contributors worldwide.

One notable project is Go Kit, a toolkit for building microservices. It's used by companies like Netflix and has a large community of contributors.

Go Kit is particularly useful for building distributed systems, as it provides a standardized way of handling tasks like service discovery and circuit breakers.

If you're new to Golang, you might want to start with a smaller project like Go-CLI. It's a simple command-line tool that helps you build and test your Go projects.

Recommended read: Go vs Golang

Understanding the Project

To get started with a golang open source project, you need to find one that aligns with your interests and skill level. GitHub's Explore page is a great place to discover trending Go repositories.

Before you can contribute to a project, you need to understand the codebase. Reading through the README.md file is a good starting point, as it often contains setup instructions or contribution guidelines.

A good project to start with is one that has existing issues labeled "good first issue" or "help wanted". This indicates that the project is open to new contributors and provides a clear starting point for your work.

Understand the Codebase

Credit: youtube.com, How To Understand a Large Codebase

Before you start contributing to a project, it's essential to understand the codebase. Reading through the README.md file is a great place to start, as it often contains setup instructions or contribution guidelines.

Familiarize yourself with existing issues labeled "good first issue" or "help wanted" to get a sense of what needs attention.

Good documentation not only explains how things work but also saves you a lot of time in the long run.

To get started, check out the following resources:

  • GitHub’s Explore page to discover trending Go repositories.
  • A curated list of Go frameworks, libraries, and software on Awesome Go.
  • Go.dev for golang-specific resources.

1. Components

Components are a crucial part of any project, and Go has some amazing libraries that make building reusable components a breeze.

Gomponents are HTML components written in pure Go, which render to HTML 5. They make it easy to focus on building your app instead of learning yet another templating language.

The Go Report Card project has a list of high-quality Go projects to learn from, including gomponents. This project aims to rate the quality of any open source Go project on Github, using various Go tools such as gofmt -s and go vet.

Here are some of the top-rated open source Go projects with at most 100 Go files, including gomponents:

These projects are a great place to start learning high-quality, idiomatic Go.

Making Contributions

Credit: youtube.com, Contributing to Open Source Can Change Your Life - Here’s How to Do It

Making contributions to open source projects is a great way to hone your coding skills. This can be done by working on real-world projects, which is a key benefit of contributing.

You can find suitable issues to work on by using the GitHub advanced search, which is a great source of various first-time suitable issues. This can help you find a project that excites you and an issue that is approachable and suitable for your skills.

Some benefits of contributing include skill development, networking, building a reputation, and making a positive impact. You can achieve these benefits by following a simple process: identify an issue, make your contribution, test your changes, submit your work, and be open to feedback.

Why Contribute?

Contributing to a project is a great way to hone your coding skills by working on real-world projects. This hands-on approach is one of the best ways to learn and improve your coding abilities.

Credit: youtube.com, Complete Guide to Open Source - How to Contribute

You'll have the opportunity to meet like-minded developers and learn from their experiences. This networking aspect can be incredibly valuable in your career.

Building an online portfolio that showcases your work is a great way to demonstrate your skills to potential employers. This can be a game-changer in the job market.

By contributing to a project, you can make a difference in areas you're passionate about. This is a chance to leave a lasting impact and see the tangible results of your efforts.

Here are some benefits of contributing to a project:

  1. Skill Development: Hone your coding skills by working on real-world projects.
  2. Networking: Meet like-minded developers and learn from their experiences.
  3. Reputation: Build an online portfolio that showcases your work.
  4. Impact: Make a difference in areas you’re passionate about!

Making Your Contribution

To identify an issue you'd like to fix, let's say you've already done that. You've found an issue that excites you and has the "good-first-issue" label.

Be respectful and concise in your messages when reaching out to maintainers, and ask if assistance is needed before starting major changes. This avoids duplicated efforts and helps maintainers juggle their responsibilities.

Credit: youtube.com, Making contributions: Mapping contribution files

Before starting, check out the contributing guidelines of a project, which could be located in .github/CONTRIBUTING.md.

When ready to submit your changes, stage them using "git add .". Then, commit using conventional commit messages, such as "fix: resolved issue #123".

To make your contribution, follow these steps:

  1. Stage your changes:
  • git add .
  • Commit using conventional commit messages:
  • git commit -m "fix: corrected handling invalid input"
  • Open up a Pull Request (PR) via the GitHub interface:

After submitting, be proactive in making adjustments swiftly if maintainers request further modifications.

Testing Your Changes

Testing your changes is crucial for maintaining quality in codebases. Testing is a must-have for any contribution.

Before making changes, it's essential to consider the impact of your code on the entire project. Testing your changes will help you identify and fix any issues early on, preventing downstream problems.

Testing is crucial for maintaining quality in codebases, and it's something that should be done regularly.

Lodash-Style Go Library

A Lodash-style Go library can be a valuable addition to your toolkit. It's based on Go 1.18+ Generics and offers dozens of handy methods to simplify common coding tasks and improve code readability.

Check this out: Golang Go

Credit: youtube.com, Live Coding - Re-creating Lodash, but MUCH smaller (shuffle)

If you're looking for a library with a short name similar to "Lodash", you're in luck. The samber/lo library has a short name and is a Lodash-style Go library based on Go 1.18+ Generics.

This library provides methods to iterate over slices, maps, channels, and more. It's like having a utility belt for your Go code.

Some of the methods provided by samber/lo overlap with those from the Go standard library, but it also offers many more valuable abstractions. In fact, it may look like Lodash in some aspects.

Here are some of the libraries created by the same developer, which you might find useful:

  • samber/do: A dependency injection toolkit based on Go 1.18+ Generics
  • samber/mo: Monads based on Go 1.18+ Generics (Option, Result, Either...)

Project Management

Project management is crucial for the success of any open source project, including those built with Golang.

Effective project management helps to ensure that projects are completed on time, within budget, and to the required quality standards.

The Go team uses a combination of automated testing and code reviews to ensure the quality of their code.

Credit: youtube.com, The BEST Tool to Structure Golang Projects

This approach has allowed the Go team to maintain a high level of code quality, with over 90% of their code covered by automated tests.

Project management tools like GitHub and GitLab provide valuable features for open source projects, including issue tracking and project planning.

These tools can help project managers to prioritize tasks, assign tasks to team members, and track progress.

The Go project uses GitHub to manage its project, with over 100 contributors working on the project.

By using project management tools, open source projects can increase transparency, collaboration, and efficiency.

For another approach, see: How to Update a Github Using Golang

Project Examples

Some of the highest-rated open source Go projects include Cockroach, a distributed relational database with a score of 89.5%, and Kubernetes, a container orchestration system with a score of 83.6%.

The top 5 projects with the highest scores are go-github, Cockroach, golang/net, xGo, and Kubernetes.

Here are the top 20 highest-rated open source Go projects with at least 100 Go files:

Uptime Kuma

Credit: youtube.com, Home Lab Monitoring Made Easy: Uptime Kuma Tutorial

Uptime Kuma is a project that caught my attention, and I think it's a great example of a high-quality Go project. It's a monitoring tool that helps you keep an eye on your services and applications.

One of the things that stood out to me about Uptime Kuma is its simplicity and ease of use. According to the GitHub topic page, it's a great example of a project that is being actively worked on, with a recent change to the codebase.

Here's a list of some other high-quality Go projects that you might find interesting:

  • go-github: a GitHub API client for Go, with a score of 97.1% on Go Report Card
  • Cockroach: a distributed SQL database, with a score of 89.5% on Go Report Card
  • golang/net: a collection of network-related packages for Go, with a score of 87.6% on Go Report Card

These projects are all great examples of what you can build with Go, and they're all actively maintained and used in the industry.

HashiCorp Vault

HashiCorp Vault is an open-source tool with a large community of developers contributing to it. It has over 33,000 stars on GitHub.

The project's popularity is evident in its high number of forks, with over 4,400 developers having forked the repository. This suggests a strong interest in using and adapting the tool for various purposes.

Credit: youtube.com, Using OIDC With HashiCorp Vault and GitHub Actions

The project's maintainers are actively working on it, with the last commit occurring just 1 day ago. This level of recent activity indicates a healthy and engaged community.

Here's a comparison of the project's metrics:

The project's metrics show a consistent level of activity, with a significant number of stars and forks. This suggests a strong interest in the project and its potential applications.

Specific Projects

The Go Report Card project, a tool that rates the quality of open source Go projects, has identified some top-notch projects to learn from.

These projects have been thoroughly vetted and scored based on factors like code quality, complexity, and formatting.

Some of the highest-rated projects include go-github, Cockroach, and Kubernetes, all of which have a score of 90% or higher.

Here are the top 5 projects from the Go Report Card list, along with their scores and number of Go files:

These projects are a great place to start learning high-quality, idiomatic Go code.

Features

African American woman working on a laptop in a modern office setting, emphasizing professional and technology themes.
Credit: pexels.com, African American woman working on a laptop in a modern office setting, emphasizing professional and technology themes.

Building specific projects requires a solid foundation, and that's exactly what this tool provides. Its features make it an ideal choice for developers who want to build reusable HTML components.

One of the standout features is the ability to build reusable HTML components. This is a game-changer for developers who want to create complex applications quickly.

The tool also allows you to write declarative HTML 5 in Go without all the strings. This means you can focus on the logic of your application without getting bogged down in tedious string manipulation.

A simple API is another key feature of this tool. If you're already familiar with HTML, you'll feel right at home with this API – it's easy to learn and use.

Useful helpers are also provided to make your development process even smoother.

Curious to learn more? Check out: Rest Api with Golang

PingCap TiDB

PingCap TiDB is a distributed relational database that's widely used in the industry. It's built on top of the Go programming language.

Credit: youtube.com, Introducing TiDB from PingCAP

One notable fact about PingCap TiDB is that it has a high-quality Go codebase, which is reflected in its rating on Go Report Card. According to the Go Report Card results, PingCap TiDB has a score of 83.6%, placing it at number 5 on the list of high-quality Go projects.

If you're looking for a project to learn from, PingCap TiDB is definitely worth checking out. Its codebase is a great example of idiomatic Go, and it's a great way to learn about distributed databases and Go programming.

Xyproto Algernon

Xyproto Algernon is a web server that packs a punch, supporting a wide range of features in a single, self-contained executable.

It has built-in support for QUIC, which is a relatively new internet protocol that aims to improve the speed and efficiency of data transfer.

Algernon also supports HTTP/2, which is a protocol that allows for faster and more efficient communication between servers and clients.

From above crop faceless male developer in black hoodie writing software code on netbook while working in light studio
Credit: pexels.com, From above crop faceless male developer in black hoodie writing software code on netbook while working in light studio

You can even run Lua code directly within the server, making it a great choice for developers who want to add custom logic to their web applications.

Algernon also comes with built-in support for various databases, including PostgreSQL, SQLite, and MariaDB/MySQL, making it easy to get started with a new project.

It's worth noting that Algernon's database support is not limited to just these options, it also supports MSSQL, which is a popular choice for larger applications.

The server also includes features like rate limiting, which can help prevent abuse and denial-of-service attacks, and graceful shutdown, which ensures that the server exits cleanly even in the face of errors.

Algernon's small size and self-contained executable make it easy to distribute and deploy, even in resource-constrained environments.

With support for multiple markup languages, including Markdown and Pongo2, Algernon makes it easy to create and serve dynamic web content.

Gogs

Gogs is a fantastic open-source project that has gained a significant following. With 47,007 stars and 5,051 forks, it's clear that many developers are interested in contributing to this project.

Group of Asian students working together in a computer lab focused on teamwork and technology.
Credit: pexels.com, Group of Asian students working together in a computer lab focused on teamwork and technology.

The project's last commit was 25 days ago, indicating that it's still actively maintained. If you're looking for a project to contribute to, Gogs might be a great place to start.

Here are some key statistics about Gogs:

Gogs is not the only popular project out there, another one is with 38,111 stars and 2,339 forks, and it's also actively maintained with a last commit 11 hours ago.

Project Discovery and Learning

Finding a project to learn from can be overwhelming, but there are some great resources to get you started. GitHub's Explore page is a great place to discover trending Go repositories.

You can also check out Awesome Go, a curated list of Go frameworks, libraries, and software. This will give you a sense of what's out there and what's popular. GitHub.dev is another great resource for golang-specific resources.

If you're looking for a specific type of project, you can use the GitHub topic around Go to discover projects instead of issues. This will give you a list of projects sorted by stars, but you can also sort by most recent change to find projects that are being actively worked on.

Credit: youtube.com, You (yes YOU) can contribute to the Go project (Carl Johnson)

To find high-quality projects to learn from, you can use the Go Report Card tool. This tool rates the quality of any open source Go project on GitHub based on various metrics. According to Go Report Card, some of the highest-rated open source repos with at most 100 Go files include:

These projects are great places to start learning high-quality, idiomatic Go.

Release and Maintenance

Golang open source projects are known for their reliability, and one reason for this is their release and maintenance process.

The Go team follows a predictable release schedule, with a new version released every six months.

This schedule is crucial for ensuring that developers can plan their projects around the latest features and security patches.

The Go team also follows a long-term support (LTS) policy, where the two most recent versions are supported for a year after the next version is released.

This allows developers to have a stable and secure base for their projects, even after the new version has been released.

The Go team is also very active in maintaining the language and its ecosystem, with a focus on ensuring that the language remains secure and reliable.

This is evident in the team's commitment to releasing security patches and bug fixes in a timely manner.

You might enjoy: Golang Version Manager

Glen Hackett

Writer

Glen Hackett is a skilled writer with a passion for crafting informative and engaging content. With a keen eye for detail and a knack for breaking down complex topics, Glen has established himself as a trusted voice in the tech industry. His writing expertise spans a range of subjects, including Azure Certifications, where he has developed a comprehensive understanding of the platform and its various applications.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.