DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Legacy Code Refactoring: Tips, Steps, and Best Practices
  • Did We Build The Right Thing? That's What UAT Is About.
  • Demystifying the Transition to Microservices
  • Agile Localization: What Is It and How Is It Managed?

Trending

  • Exploring the Evolution and Impact of Computer Networks
  • Beyond the Prompt: Unmasking Prompt Injections in Large Language Models
  • Harnessing the Power of In-Memory Databases: Unleashing Real-Time Data Processing
  • Introduction to ESP32 for Beginners Using the Xedge32 Lua IDE
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Why It's Time For Go Packages to Start Versioning

Why It's Time For Go Packages to Start Versioning

The current state of versioning in Go projects and why it's worth it to start versioning now.

Matt Farina user avatar by
Matt Farina
·
Nov. 20, 15 · Opinion
Like (4)
Save
Tweet
Share
2.39K Views

Join the DZone community and get the full member experience.

Join For Free

tl;dr: Please provide semantically versioned releases of your packages and libraries.

Update: There is a proposal to bring semantic versioning to the Go community.

When it comes to package management the Go community is different from the rest. There are some places that's not a good thing and release versions happen to be one of them. In general Go packages, many of which are used in production, have no identifiable version other than a commit ID and that's a problem.

Why Bother Versioning?

There are theoretical and then there are practical reasons to version. I want to share a little of both by example.

  1. Kubernetes has quite a few dependencies. And its dependencies have dependencies. Sometimes they share a dependency but list different versions of it. If you took the version specified by Kubernetes and the versions specified by their dependencies you'll find 42 conflicts (as or writing this post). A conflict is there two different versions are being specified (often in a Godep file). Since they are all specified as commit IDs there's not way to distinguish a difference. When I looked deeper (by hand) I found cases were versions could be years apart in time. This is not ideal.
  2. What if I asked you to use version f9885acc8cd1403afcd09570c89a009e8bd1dc19 of OpenSSL? Or, what if that's the version bundled in something you downloaded? Would you feel safe using that. Based on the commit ID there's no real way to tell when it came from. Is it safe? It's not safe. This version is susceptible to Heartbleed. No one does this with OpenSSL. They use versions so a simple version comparison can tell if it's safe. Thankfully OpenSSL doesn't version by commit ID.
  3. Stability can be an issue. I was recently working on a project that pulled in some 3rd party libraries. The problem was one of stability. The latest commit wasn't stable. It didn't work. So, work had to be done to walk through the commits to find one that worked. This is tedious and annoying. If there are stable releases you can use that. It's not like most people run the latest commit of Go, Firefox, or well just about anything else.

Note, if you believe Go packages only need to be tied to the commit IDs then I challenge you to run everything that way. The Go toolchain, your browser, and all of it.

Other Language Communities

I've been looking at how other language communities handle packages. I decided to look at release versions in these communities and I was going to attempt to calculate a percent of packages in those communities that have release versions. But, I found that all the popular packages have releases and some communities require them. It was hard to find a package with any kind of adoption that didn't have releases. I didn't calculate a percentage because it's a tiny fraction of a percent.

The State of Go Versioning

So, how does Go compare? I used tools such as Godoc and Go Search to find the top packages. The packages fell into 5 categories:

  1. 9 of the top 20 most imported according to Go Search had no release versions at all. When I look at other lists on Godoc or Go Search these ratio of only about half having versions holds up. To go further I looked at GitHub Trends for Go packages (excluding applications written in Go) and found 75% for the past month didn't have release versions.
  2. Of those that have release versions many are out of date. It's not unusual to have the latest release be over a year old. Sometimes closer to two years. There can be many, sometimes hundreds of, commits since then. While these versioned releases exist they are essentially useless.
  3. Those who are using gopkg.in. These really fall into two categories. Those who are doing incremental releases and those who just have a major branch you need to follow. The latter is similar to not versioning except you have the major version API break handled. The former is great and I like to see it.
  4. Some have tags that have meaning only to that project. Are these releases? What do they mean? I don't know because it's not obvious. They appear to be one offs.
  5. Some use release versions, keep making releases, and I'm overjoyed to see them. It makes me smile when I see packages like beego and logrus releasing versions.

There's more to the state of Go besides the state of the releases on packages. You need tools that can leverage them. Here are a few:

  • gopkg.in has been around for some time to allow projects on GitHub to handle versions through imports.
  • Glide is a package manager for Go and the GO15VENDOREXPERIMENT. You can specify versions and ranges (e.g., ^1.2.3).
  • gb-vendor will let you specify tags that can be versions (no SemVer range filtering yet but I've read the Dave wants to add it).

We are starting to see the rise of tools that can use the versions intelligently.

Please Use Semantic Versioning

It's not only time to start versioning but to use semantic versioning (SemVer). SemVer is a specification and you can derive meaning from the version numbers allowing for useful comparisons. SemVer or something very similar is what every other programming language community uses. The newer language communities are using it explicitly. Since SemVer is a spec we don't need to argue about what should be in it and there are already packages allowing you to work with them.

It's time for the Go community to have semantically versioned releases of all packages. It's what all the mature language communities do. We should join them.

IT Release (agency) Commit (data management)

Published at DZone with permission of Matt Farina, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Legacy Code Refactoring: Tips, Steps, and Best Practices
  • Did We Build The Right Thing? That's What UAT Is About.
  • Demystifying the Transition to Microservices
  • Agile Localization: What Is It and How Is It Managed?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: