{"id":36860133,"url":"https://github.com/usvc/go-semver","last_synced_at":"2026-01-12T14:49:23.123Z","repository":{"id":57515852,"uuid":"242294641","full_name":"usvc/go-semver","owner":"usvc","description":"A Go package to deal with semantic versions as defined by https://semver.org","archived":false,"fork":false,"pushed_at":"2020-03-17T12:08:19.000Z","size":55,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T22:04:26.067Z","etag":null,"topics":["go","golang","golang-library","golang-package","semantic-version","semver"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usvc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-22T06:51:33.000Z","updated_at":"2020-03-17T12:00:05.000Z","dependencies_parsed_at":"2022-08-28T16:51:42.146Z","dependency_job_id":null,"html_url":"https://github.com/usvc/go-semver","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/usvc/go-semver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-semver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-semver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-semver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-semver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usvc","download_url":"https://codeload.github.com/usvc/go-semver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-semver/sbom","scorecard":{"id":912913,"data":{"date":"2025-08-11","repo":{"name":"github.com/usvc/go-semver","commit":"54799657f4df6df4debda90f8f9f813edf0ad185"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.0.15 not signed: https://api.github.com/repos/usvc/go-semver/releases/24323603","Warn: release artifact v0.0.13 not signed: https://api.github.com/repos/usvc/go-semver/releases/24162149","Warn: release artifact v0.0.12 not signed: https://api.github.com/repos/usvc/go-semver/releases/24156559","Warn: release artifact v0.0.11 not signed: https://api.github.com/repos/usvc/go-semver/releases/24152380","Warn: release artifact v0.0.10 not signed: https://api.github.com/repos/usvc/go-semver/releases/24140851","Warn: release artifact v0.0.15 does not have provenance: https://api.github.com/repos/usvc/go-semver/releases/24323603","Warn: release artifact v0.0.13 does not have provenance: https://api.github.com/repos/usvc/go-semver/releases/24162149","Warn: release artifact v0.0.12 does not have provenance: https://api.github.com/repos/usvc/go-semver/releases/24156559","Warn: release artifact v0.0.11 does not have provenance: https://api.github.com/repos/usvc/go-semver/releases/24152380","Warn: release artifact v0.0.10 does not have provenance: https://api.github.com/repos/usvc/go-semver/releases/24140851"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: deploy/Dockerfile:1","Warn: containerImage not pinned by hash: deploy/Dockerfile:11: pin your Docker image by updating gcr.io/distroless/base-debian10 to gcr.io/distroless/base-debian10@sha256:101798a3b76599762d3528635113f0466dc9655ecba82e8e33d410e2bf5cd319","Info:   0 out of   2 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-2456 / GHSA-449p-3h89-pw88","Warn: Project is vulnerable to: GO-2024-2466 / GHSA-mw99-9chc-xw7r","Warn: Project is vulnerable to: GO-2025-3367 / GHSA-r9px-m959-cxf4","Warn: Project is vulnerable to: GO-2025-3368 / GHSA-v725-9546-7q7m"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T19:54:34.034Z","repository_id":57515852,"created_at":"2025-08-24T19:54:34.034Z","updated_at":"2025-08-24T19:54:34.034Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","golang-library","golang-package","semantic-version","semver"],"created_at":"2026-01-12T14:49:23.010Z","updated_at":"2026-01-12T14:49:23.106Z","avatar_url":"https://github.com/usvc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semver\n\n[![latest release](https://badge.fury.io/gh/usvc%2Fgo-semver.svg)](https://github.com/usvc/go-semver/releases)\n[![pipeline status](https://gitlab.com/usvc/modules/go/semver/badges/master/pipeline.svg)](https://gitlab.com/usvc/modules/go/semver/-/commits/master)\n[![Build Status](https://travis-ci.org/usvc/go-semver.svg?branch=master)](https://travis-ci.org/usvc/go-semver)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/7812e899e2569dfab702/test_coverage)](https://codeclimate.com/github/usvc/go-semver/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/7812e899e2569dfab702/maintainability)](https://codeclimate.com/github/usvc/go-semver/maintainability)\n\nA Go package to deal with semantic versions as defined at [https://semver.org](https://semver.org).\n\n| | |\n| --- | --- |\n| Github | [https://github.com/usvc/go-semver](https://github.com/usvc/go-semver) |\n| Gitlab | [https://gitlab.com/usvc/modules/go/semver](https://gitlab.com/usvc/modules/go/semver) |\n\n- - -\n\n- [Semver](#semver)\n  - [Usage](#usage)\n    - [Importing](#importing)\n    - [Parsing a semantic version string](#parsing-a-semantic-version-string)\n    - [Retrieving semantic version as a string](#retrieving-semantic-version-as-a-string)\n    - [Sorting semantic versions](#sorting-semantic-versions)\n  - [Development Runbook](#development-runbook)\n    - [Getting Started](#getting-started)\n    - [Continuous Integration (CI) Pipeline](#continuous-integration-ci-pipeline)\n      - [On Github](#on-github)\n        - [Releasing](#releasing)\n      - [On Gitlab](#on-gitlab)\n        - [Version Bumping](#version-bumping)\n        - [DockerHub Publishing](#dockerhub-publishing)\n  - [Licensing](#licensing)\n\n## Usage\n\n### Importing\n\n```go\nimport \"github.com/usvc/go-semver\"\n```\n\n### Parsing a semantic version string\n\n```go\nsemver.Parse(\"1.0.0-alpha.1+202022022637\")\n```\n\n### Retrieving semantic version as a string\n\n```go\n// setting up fictitious semantic version\nversion := Semver{\n  Prefix: \"v\",\n  VersionCore: semver.VersionCore{\n    Major: 1,\n    Minor: 2,\n    Patch: 3,\n  },\n  PreRelease: semver.PreRelease{\n    \"alpha\", \"1\",\n  },\n  BuildMetadata: semver.BuildMetadata{\n    \"202022022637\",\n  },\n}\n\n// the magic follows\nfmt.Println(version.String())\n// v1.2.3-alpha.1+202022022637\n```\n\n### Sorting semantic versions\n\n```go\nstringVersions := []string{\"1.2.1\", \"3.1.0\", \"2.0.0\", \"1.0.0\", \"2.0.0-alpha\"}\nsemverVersions := semver.Semvers{}\nfor i := 0; i \u003c len(stringVersions); i++ {\n  semverVersion, _ := semver.Parse(stringVersions[i])\n  semverVersions = append(semverVersions, *semverVersion)\n}\nsort.Sort(semverVersions)\nfor i := 0; i \u003c len(semverVersions); i++ {\n  fmt.Println(semverVersions[i].String())\n}\n// 1.0.0\n// 1.2.1\n// 2.0.0-alpha\n// 2.0.0\n// 3.1.0\n```\n\n## Development Runbook\n\n### Getting Started\n\n1. Clone this repository\n2. Run `make deps` to pull in external dependencies\n3. Write some awesome stuff\n4. Run `make test` to ensure unit tests are passing\n5. Push\n\n### Continuous Integration (CI) Pipeline\n\n#### On Github\n\nGithub is used to deploy binaries/libraries because of it's ease of access by other developers.\n\n##### Releasing\n\nReleasing of the binaries can be done via Travis CI.\n\n1. On Github, navigate to the [tokens settings page](https://github.com/settings/tokens) (by clicking on your profile picture, selecting **Settings**, selecting **Developer settings** on the left navigation menu, then **Personal Access Tokens** again on the left navigation menu)\n2. Click on **Generate new token**, give the token an appropriate name and check the checkbox on **`public_repo`** within the **repo** header\n3. Copy the generated token\n4. Navigate to [travis-ci.org](https://travis-ci.org) and access the cooresponding repository there. Click on the **More options** button on the top right of the repository page and select **Settings**\n5. Scroll down to the section on **Environment Variables** and enter in a new **NAME** with `RELEASE_TOKEN` and the **VALUE** field cooresponding to the generated personal access token, and hit **Add**\n\n#### On Gitlab\n\nGitlab is used to run tests and ensure that builds run correctly.\n\n##### Version Bumping\n\n1. Run `make .ssh`\n2. Copy the contents of the file generated at `./.ssh/id_rsa.base64` into an environment variable named **`DEPLOY_KEY`** in **Settings \u003e CI/CD \u003e Variables**\n3. Navigate to the **Deploy Keys** section of the **Settings \u003e Repository \u003e Deploy Keys** and paste in the contents of the file generated at `./.ssh/id_rsa.pub` with the **Write access allowed** checkbox enabled\n\n- **`DEPLOY_KEY`**: generate this by running `make .ssh` and copying the contents of the file generated at `./.ssh/id_rsa.base64`\n\n##### DockerHub Publishing\n\n1. Login to [https://hub.docker.com](https://hub.docker.com), or if you're using your own private one, log into yours\n2. Navigate to [your security settings at the `/settings/security` endpoint](https://hub.docker.com/settings/security)\n3. Click on **Create Access Token**, type in a name for the new token, and click on **Create**\n4. Copy the generated token that will be displayed on the screen\n5. Enter the following varialbes into the CI/CD Variables page at **Settings \u003e CI/CD \u003e Variables** in your Gitlab repository:\n\n- **`DOCKER_REGISTRY_URL`**: The hostname of the Docker registry (defaults to `docker.io` if not specified)\n- **`DOCKER_REGISTRY_USERNAME`**: The username you used to login to the Docker registry\n- **`DOCKER_REGISTRY_PASSWORD`**: The generated access token\n\n## Licensing\n\nCode in this package is licensed under the [MIT license (click to see full text))](./LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusvc%2Fgo-semver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusvc%2Fgo-semver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusvc%2Fgo-semver/lists"}