{"id":16928396,"url":"https://github.com/knqyf263/go-deb-version","last_synced_at":"2025-05-16T14:08:39.698Z","repository":{"id":20129604,"uuid":"88329400","full_name":"knqyf263/go-deb-version","owner":"knqyf263","description":"A golang library for parsing deb package versions","archived":false,"fork":false,"pushed_at":"2024-11-15T13:26:51.000Z","size":19,"stargazers_count":38,"open_issues_count":1,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T12:53:16.777Z","etag":null,"topics":["golang","library","parser"],"latest_commit_sha":null,"homepage":"","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/knqyf263.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-15T06:43:04.000Z","updated_at":"2024-11-20T17:02:26.000Z","dependencies_parsed_at":"2025-01-08T02:03:30.220Z","dependency_job_id":"c4051bd9-0420-4f5a-bbd0-e4af686c4906","html_url":"https://github.com/knqyf263/go-deb-version","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knqyf263%2Fgo-deb-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knqyf263%2Fgo-deb-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knqyf263%2Fgo-deb-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knqyf263%2Fgo-deb-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knqyf263","download_url":"https://codeload.github.com/knqyf263/go-deb-version/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544146,"owners_count":22088807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["golang","library","parser"],"created_at":"2024-10-13T20:36:39.468Z","updated_at":"2025-05-16T14:08:39.672Z","avatar_url":"https://github.com/knqyf263.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-deb-version\n\n[![Build Status](https://travis-ci.org/knqyf263/go-deb-version.svg?branch=master)](https://travis-ci.org/knqyf263/go-deb-version)\n[![Coverage Status](https://coveralls.io/repos/github/knqyf263/go-deb-version/badge.svg)](https://coveralls.io/github/knqyf263/go-deb-version)\n[![Go Report Card](https://goreportcard.com/badge/github.com/knqyf263/go-deb-version)](https://goreportcard.com/report/github.com/knqyf263/go-deb-version)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/knqyf263/go-deb-version/blob/master/LICENSE)\n\nA Go library for parsing package versions\n\ngo-deb-version is a library for parsing and comparing versions\n\nVersions used with go-deb-version must follow [deb-version](http://man.he.net/man5/deb-version) (ex. 2:6.0-9ubuntu1)  \nThe implementation is based on [Debian Policy Manual](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version)\n\nOS: Debian, Ubnutu\n\n\n# Installation and Usage\n\nInstallation can be done with a normal go get:\n\n```\n$ go get github.com/knqyf263/go-deb-version\n```\n\n## Version Parsing and Comparison\n\n```\nimport \"github.com/knqyf263/go-deb-version\"\n\nv1, err := version.NewVersion(\"2:6.0-9\")\nv2, err := version.NewVersion(\"2:6.0-9ubuntu1\")\n\n// Comparison example. There is also GreaterThan, Equal.\nif v1.LessThan(v2) {\n    fmt.Printf(\"%s is less than %s\", v1, v2)\n}\n```\n\n## Version Sorting\n\n```\nraw := []string{\"7.4.052-1ubuntu3.1\", \"7.4.052-1ubuntu3\", \"7.1-022+1ubuntu1\", \"7.1.291-1\", \"7.3.000+hg~ee53a39d5896-1\"}\nvs := make([]version.Version, len(raw))\nfor i, r := range raw {\n\tv, _ := version.NewVersion(r)\n\tvs[i] = v\n}\n\nsort.Slice(vs, func(i, j int) bool {\n\treturn vs[i].LessThan(vs[j])\n})\n```\n\n# Contribute\n\n1. fork a repository: github.com/knqyf263/go-deb-version to github.com/you/repo\n2. get original code: `go get github.com/knqyf263/go-deb-version`\n3. work on original code\n4. add remote to your repo: git remote add myfork https://github.com/you/repo.git\n5. push your changes: git push myfork\n6. create a new Pull Request\n\n- see [GitHub and Go: forking, pull requests, and go-getting](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)\n\n----\n\n# License\nMIT\n\n# Author\nTeppei Fukuda\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknqyf263%2Fgo-deb-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknqyf263%2Fgo-deb-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknqyf263%2Fgo-deb-version/lists"}