Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Feb 28, 2022
1 parent a7b98f6 commit 4e4defa
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@


# go.bug.st/relaxed-semver [![build status](https://api.travis-ci.org/bugst/relaxed-semver.svg?branch=master)](https://travis-ci.org/bugst/relaxed-semver) [![codecov](https://codecov.io/gh/bugst/relaxed-semver/branch/master/graph/badge.svg)](https://codecov.io/gh/bugst/relaxed-semver)
# go.bug.st/relaxed-semver [![build status](https://github.com/bugst/relaxed-semver/workflows/test/badge.svg)](https://travis-ci.org/bugst/relaxed-semver) [![codecov](https://codecov.io/gh/bugst/relaxed-semver/branch/master/graph/badge.svg)](https://codecov.io/gh/bugst/relaxed-semver)

A library for handling a superset of semantic versioning in golang.

Expand All @@ -12,9 +10,10 @@ See the godoc here: https://godoc.org/go.bug.st/relaxed-semver

This library tries to implement the semantic versioning specification [2.0.0](https://semver.org/spec/v2.0.0.html) with an exception: the numeric format `major.minor.patch` like `1.3.2` may be truncated if a number is zero, so:

- `1.2.0` or `1.2.0-beta` may be written as `1.2` or `1.2-beta` respectively
- `1.0.0` or `1.0.0-beta` may be written `1` or `1-beta` respectively
- `0.0.0` may be written as the **empty string**, but `0.0.0-beta` may **not** be written as `-beta`
- `1.2.0` or `1.2.0-beta` may be written as `1.2` or `1.2-beta` respectively
- `1.0.0` or `1.0.0-beta` may be written `1` or `1-beta` respectively
- `0.0.0` may be written as the **empty string**, but `0.0.0-beta` may **not** be written as `-beta`

## Usage

You can parse a semver version string with the `Parse` function that returns a `Version` object that can be used to be compared with other `Version` objects using the `CompareTo`, `LessThan` , `LessThanOrEqual`, `Equal`, `GreaterThan` and `GreaterThanOrEqual` methods.
Expand All @@ -35,4 +34,4 @@ To parse a `RelaxedVersion` you can use the `ParseRelaxed` function.

## Json parsable

The `Version` and `RelaxedVersion` have the JSON un/marshaler implemented so they can be JSON decoded/encoded.
The `Version` and `RelaxedVersion` have the JSON un/marshaler implemented so they can be JSON decoded/encoded.

0 comments on commit 4e4defa

Please sign in to comment.