Benedikt Lang
2f3112b6f8
New() and Make()
Introduce Make() which is an alias for Parse() and returns a version as value. New() changed to return a pointer.
Breaking changes:
Change New() to Make() to fix pointer vs value problem.
11 years ago
Alexandru Cojocaru
fe545f5595
Add MustParse
Closes #14
11 years ago
Benedikt Lang
9bf7bff48b
README: Add json feature
11 years ago
Josh Hawn
5b0d386fa2
Implements json.Marshaler and json.Unmarshaler
Uses simple JSON string (un)marshaling under the
hood and Parse() on validating unmarshaled content.
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
11 years ago
Benedikt Lang
42513fed74
Update benchmarks
11 years ago
Chris Bandy
0575a3cfd7
Start with a slice large enough for the minimum version
Closes #12
11 years ago
Benedikt Lang
907ae8488a
Remove unnecessary constants and range checks
11 years ago
Benedikt Lang
570f3051b5
String benchmark results
11 years ago
Chris Bandy
35e41ad4ee
Use byte slice to build Version string
Closes #11
11 years ago
Chris Bandy
658dfb434e
Benchmarks for String()
11 years ago
Benedikt Lang
c2ac2cf0fb
Push to version 2.0.0
Breaking changes:
Changed from pointers to value arguments.
If this breaks your code, use latest stable v1 (tag:v1.1.0).
You could also use gopkg.in: go get http://gopkg.in/blang/semver.v1
11 years ago
Chris Bandy
f4dbd8b7a4
Simplify Scan() slightly
Closes #10
11 years ago
Chris Bandy
58baed933f
Show that numbers larger than uint64 cannot be parsed
Closes #9
11 years ago
Chris Bandy
1721683170
Fix error messages to match assertions
Closes #8
11 years ago
Chris Bandy
fa1b4b2f13
Simplify parsing by using more slices
Closes #7
11 years ago
Benedikt Lang
61fed1c667
Add additional compare helpers
11 years ago
Benedikt Lang
7f12584be1
Sortable slice of versions
11 years ago
Benedikt Lang
c8864c2e3e
Change to value arguments
11 years ago
Benedikt Lang
0d739aeb6a
Remove unnecessary pointer arguments
Resolves #6
11 years ago
Benedikt Lang
b1824b988f
README: Add database/sql compatibility
11 years ago
tike
272ed2e7e4
Added methods to implement sql related interfaces.
Version.Scan -> database/sql.Scanner
Version.Value -> database/sql/driver.Valuer
Closes #4
Closes #5
11 years ago
Benedikt Lang
f1812354c1
Merge pull request #2 from jstnlef/minor-refactoring
Minor refactor to hasLeadingZeros
12 years ago
Justin LeFebvre
50c0e52521
much simpler logic without requiring a branch condition
12 years ago
Justin LeFebvre
b5ecf012db
really minor change to the logic here
12 years ago
Benedikt Lang
0f7f01176b
Remove constants export
12 years ago
Benedikt Lang
e44422b4e4
Merge pull request #1 from jstnlef/buffer-to-string-array
Using string slices instead of bytes.Buffer in Version.String()
12 years ago
Justin LeFebvre
30bbe0b4a7
there is no need to use a bytes buffer when string slices are efficient enough. This is especially true since the version strings are guaranteed to be sufficiently small
12 years ago
Benedikt Lang
f7866e526f
README: Coverage status badge upate, semver link
12 years ago
Benedikt Lang
a5a1870145
Use drone.io instead of travisci
12 years ago
Benedikt Lang
ed35585ae3
Add Travis-ci config
12 years ago
Benedikt Lang
dc253f7f1d
README: Format, godoc link
12 years ago
Benedikt Lang
ab6403b31a
Hide constants
12 years ago
Benedikt Lang
c2a6207ef9
Add spec #9 test
12 years ago
Benedikt Lang
e030971c62
Check for leading zeroes
12 years ago
Benedikt Lang
d6107de3e7
Add drone.io build status
12 years ago
Benedikt Lang
58fd7ff9c3
README, examples, benchmarks
12 years ago
Benedikt Lang
6bee9cf8c9
Add validation, further tests, compare helpers
12 years ago
Benedikt Lang
a76e16a4c7
Full working set, missing some tests
12 years ago
Benedikt Lang
d2e12bf84b
First draft
12 years ago
Benedikt Lang
1ea2d28cc8
Add license
12 years ago