Commit Graph

136 Commits

Author SHA1 Message Date
Maxim Bublis f58768cc1a Add support for setting variant bits other than RFC4122. 2018-01-03 15:23:54 +00:00
Maxim Bublis 063359185d Update copyright year. 2018-01-03 00:35:58 +00:00
Maxim Bublis 980eb8c1d5 Rewrite tests using gocheck. 2018-01-03 00:28:15 +00:00
Maxim Bublis 95d61fadb1 Moved codecs suport into `codec.go` 2018-01-03 00:28:15 +00:00
Maxim Bublis 2558856ae9 Moved database support into `sql.go`. 2018-01-02 20:56:48 +00:00
Maxim Bublis b27323f250 Use Must helper for namespace UUIDs initialization. 2018-01-02 20:38:35 +00:00
Maxim Bublis ceccb20d4a Merge pull request #62 from alexeykudinkin/gen-split
Abstracted generating logic behind `Generator` interface for easy
mocking in tests.
2018-01-02 20:22:47 +00:00
Alexey Kudinkin b86a6b7dda Moved all generation related logic into `generator.go`.
Abstracted behind `Generator` interface for easy mocking in tests.
2018-01-02 20:21:13 +00:00
Maxim Bublis 508dbd67f2 Remove obsolete tests. 2018-01-02 18:15:32 +00:00
Maxim Bublis 57d18d3c55 Remove binary uuid AND and OR operations.
This functionality is pretty much misleading and non-standard.
2018-01-02 16:09:01 +00:00
Maxim Bublis 8be4f1c3d9 Merge pull request #54 from daskol/parse-from-string
Refactor UnmarshalText in order to parse hash-like UUID.
2018-01-02 15:43:10 +00:00
Daniel Bershatsky 23a7b8435b Refactor UnmarshalText in order to parse hash-like UUID. 2018-01-02 15:11:40 +00:00
Maxim Bublis 3b14077cbb
Merge pull request #55 from kevinburke/add-size
Add Size constant
2018-01-02 14:14:55 +00:00
Maxim Bublis afe01f2532
Merge pull request #52 from marclave/marc/feature/Must_helper_wrapper
Add must helper
2018-01-02 14:12:52 +00:00
Maxim Bublis bba152fbf2 Build against Go 1.9. 2018-01-02 14:07:02 +00:00
Maxim Bublis 2c3b1967c1
Merge pull request #51 from SCKelemen/patch-1
Update copyright year
2018-01-02 14:02:29 +00:00
Kevin Burke 0ca0c2cf9e
Add Size constant
If I want to account for the size of a UUID in bytes in my package,
it would be nice to be able to write `uuid.Size` (to make it clear to
readers why I'm adding this many bytes) instead of the magic number
"16".
2017-08-15 11:39:26 -07:00
marclave 1d213916d1 Add must helper
A Must function is idiomatic go; the benefit of having a must is to
panic when it is not a valid UUID vs error handle.
2017-06-28 09:57:42 -07:00
Samuel Kelemen 13ac7b16c2 Update Copyright Year, again 2017-06-12 10:33:36 -05:00
Maxim Bublis 5bf94b69c6 Merge pull request #45 from erizocosmico/patch-1
Add go 1.8 to travis matrix
2017-03-21 23:07:31 +00:00
Miguel Molina 1d9318df9b Add go 1.8 to travis matrix 2017-03-21 15:21:08 +01:00
Maxim Bublis b061729afc Make Go tip a fast-finish allowed feature for CI. 2016-09-27 11:08:44 +01:00
Maxim Bublis 8dc46065cf Merge pull request #37 from kevinburke/go-1.7
Add Go 1.7 and latest
2016-09-27 11:05:31 +01:00
Maxim Bublis ea50dc35f3 Merge pull request #36 from kevinburke/fix-vet
Fix errors reported by go vet
2016-09-27 11:01:08 +01:00
Kevin Burke 44ab8e0dc1 Add Go 1.7 and latest
Go 1.7 was released recently and it seems useful to test against the Go tip as
well, for people that run release candidates.
2016-08-23 20:53:48 -07:00
Kevin Burke e9dec51388 Fix errors reported by go vet
For the benchmark, `u.String()` or the loop could
potentially be optimized away by the compiler (see
http://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go for more
information). A format string in uuid_test.go has the wrong type.
2016-08-23 18:20:22 -07:00
Maxim Bublis 0aa62d5ddc Remove version check in UnmarshalText method. 2016-07-13 19:03:06 +01:00
Maxim Bublis 879c5887cd Add coverage badge. 2016-06-07 15:43:47 +01:00
Maxim Bublis 2d64dad091 Remove Go 1.0 and 1.1 from CI.
By this time they are probably so old already that noone uses them.
2016-06-07 15:37:55 +01:00
Maxim Bublis f8cc937423 Enable test coverage in CI. 2016-06-07 15:28:05 +01:00
Maxim Bublis fce4b1f106 Merge pull request #23 from jrouviere/master
Interpret SQL NULL values as uuid.Nil
2016-06-07 15:07:18 +01:00
Maxim Bublis 092be99594 Merge pull request #27 from Mjolnir42/master
Improve input validation in UnmarshalText
2016-06-07 15:05:07 +01:00
Jörg Pernfuß 561449c091 Handle braced format with trailing characters 2016-06-03 01:09:06 +00:00
Jörg Pernfuß 90e70752a6 Make UnmarshalText parse more strictly
With these updates, all updated tests are passed and
no invalid strings are converted to UUID.
2016-06-03 00:43:55 +00:00
Jörg Pernfuß b111a074d5 Update FromString tests: long and invalid strings
This adds two new tests for overly long and otherwise invalidly
formatted strings to the FromString tests.

The most failure case is the acceptance of arbitrarily long hex
strings and truncating the first 32 characters to a UUID.

--- FAIL: TestFromStringLong (0.00s)
        uuid_test.go:250: Should return error trying to parse too long string, passed 6ba7b810-9dad-11d1-80b4-00c04fd430c8=
        uuid_test.go:250: Should return error trying to parse too long string, passed 6ba7b810-9dad-11d1-80b4-00c04fd430c8}
        uuid_test.go:250: Should return error trying to parse too long string, passed 6ba7b810-9dad-11d1-80b4-00c04fd430c800c04fd430c8
--- FAIL: TestFromStringInvalid (0.00s)
        uuid_test.go:275: Should return error trying to parse invalid string, passed 6ba7b8109dad11d180b400c04fd430c8
        uuid_test.go:275: Should return error trying to parse invalid string, passed 6ba7b8109dad11d180b400c04fd430c86ba7b8109dad11d180b400c04fd430c8
        uuid_test.go:275: Should return error trying to parse invalid string, passed 6ba7b810-9dad11d180b400c04fd430c8
        uuid_test.go:275: Should return error trying to parse invalid string, passed 6ba7b8109dad-11d180b400c04fd430c8
        uuid_test.go:275: Should return error trying to parse invalid string, passed 6ba7b8109dad11d1-80b400c04fd430c8
        uuid_test.go:275: Should return error trying to parse invalid string, passed 6ba7b8109dad11d180b4-00c04fd430c8
2016-06-03 00:42:25 +00:00
Julien Rouviere cba34673b5 Introduce NullUUID type to handle NULL SQL values
NullUUID works similarly to NullString from the database/sql package, it represents a UUID that can be NULL, a Valid boolean indicates if the value was NULL or not.
2016-04-30 20:05:32 +01:00
Maxim Bublis f9ab0dce87 Merge pull request #21 from tomstokes/master
Fix UnmarshalText panic on invalid short uuid
2016-03-24 11:22:44 +00:00
Tom Stokes 89fb462add Fix UnmarshalText panic on invalid short uuid
Fixes satori/go.uuid#20
2016-03-23 10:37:25 -06:00
Maxim Bublis e673fdd4de Do not explicitly list tested Go version. 2016-02-18 23:57:46 +00:00
Maxim Bublis 3f27fd81c8 Build against Go 1.6. 2016-02-18 23:47:21 +00:00
Maxim Bublis 188f20c31e Update copyright year. 2016-02-18 23:47:04 +00:00
Maxim Bublis d41af8bb6a Merge pull request #16 from fromYukki/master
Implement driver.Valuer interface
2015-10-29 02:17:19 +03:00
Maksim Naumov 676762fded Implement driver.Valuer interface 2015-10-28 09:07:30 +01:00
Maxim Bublis 08f0718b61 Update tested Go versions. 2015-08-29 05:49:07 +03:00
Maxim Bublis 5def0cd4dd Build against Go 1.5. 2015-08-29 05:45:53 +03:00
Maxim Bublis 6b8e5b55d2 Merge pull request #14 from marginlabs/from-string-or-nil
Add FromStringOrNil/FromBytesOrNil functions.
2015-07-22 13:23:20 +03:00
Artem Nezvigin bb07160e36 Add FromBytesOrNil 2015-07-22 02:38:27 -07:00
Artem Nezvigin 1384c63220 Add FromStringOrNil 2015-07-20 23:29:55 -07:00
Maxim Bublis afe1e2ddf0 Omit epochFunc variable type as it will be inferred from the value. 2015-06-15 05:45:37 +03:00
Maxim Bublis 79765f767f Merge pull request #13 from cbandy/optional-random
Initialize v1 and v2 storage only when it is used
2015-06-08 16:37:37 +03:00