Masterminds / Masterminds/semver

Functions to decrease version numbers

Open Beginner friendly
#153 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.4k
Forks
168
PR merge metrics
No merged PRs in 30d

Description

Problem:
In one of my projects I need an internal fallback version to the current version. This fallback version should be the direct minor or major predecessor of the current version. In my case I would need the possibility to reduce the number of the major or minor version.

Example:
Current version: v0.20.0
Fallback version: v0.19.0

Proposed solution:
We would need the exact opposite of the functions IncMajor, IncMinor, IncPatch (e.g. DecMajor, DecMinor, DecPatch) which would decrease the version numbers respectively.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing IncMajor, IncMinor, and IncPatch functions and read how their version changes are tested. Add the corresponding decrease behavior for major, minor, and patch versions, then verify that the v0.20.0 example produces v0.19.0 and that the existing tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.