Commit Graph

20 Commits (b0fc331c6d30d97b417ce0cd1f95fa8619a4ea67)

Author SHA1 Message Date
Mark Rushakoff 7ae106d14a chore: add GoString method to platform.ID
While debugging, I was printing out some structs with %#v and found that
Go would format the structs' IDs as uint64s instead of with the String
method. That behavior needlessly made my debugging more difficult.

Before, %#v would format a type with an ID like:

    {ID:0x2def021097c6000}

After:

    {ID:"02def021097c6000"}

They look similar, but a search for the string ID would not match the
uint64 default formatting.
2018-10-31 14:41:47 -07:00
Chris Goller e7d75b7162 perf(id): decrease allocations for id decoding 2018-10-11 09:54:19 -05:00
Chris Goller 2bea48f15a refactor(testing): rename MustIDFromString to MustIDBase16 2018-10-11 09:54:19 -05:00
Chris Goller b68a98043d refactor(id): update name to IDLength 2018-10-11 09:54:19 -05:00
Leonardo Di Donato 6725ae6f64 feat(platform/id): method to create an invalid id
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-10-11 09:54:18 -05:00
Leonardo Di Donato 8d7f06cf4b feat(platform/id): using uint64 for platform.IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-Authored-by: Lorenzo Fontana <lo@linux.com>
2018-10-11 09:54:18 -05:00
Michael Desa 8c87c9d132 revert #442 2018-08-01 14:54:32 -04:00
Leonardo Di Donato 43ebb0251f Improvements to platform.ID errors
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-08-01 18:20:59 +02:00
Leonardo Di Donato 5addb88eb5 MustIDFromString no more requires test instance
It panics now.
2018-08-01 18:20:59 +02:00
Leonardo Di Donato c16a855a58 Better naming for the ID length constant 2018-08-01 18:20:59 +02:00
Leonardo Di Donato bba4e4d69f Moving ID tests in platform_test package to avoid circular deps 2018-08-01 18:20:59 +02:00
Leonardo Di Donato c6b8c9d82e All zeros ID considered invalid 2018-08-01 18:20:59 +02:00
Leonardo Di Donato 4387206181 Other test for IDs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-08-01 18:20:59 +02:00
Leonardo Di Donato bcd4e7e675 Fix ID error about exact length 2018-08-01 18:20:59 +02:00
Leonardo Di Donato fac113821e Testing marshalling of IDs and viceversa 2018-08-01 18:20:59 +02:00
Leonardo Di Donato 617795da5d Testing IDs 2018-08-01 18:20:59 +02:00
Leonardo Di Donato 31bcd42d05 Fix testing of ID from string function
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-08-01 18:20:59 +02:00
Leonardo Di Donato bc03eb2d2b Tests for platform.ID
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-08-01 18:20:59 +02:00
Leonardo Di Donato 5335c52c87 Initial tests for platform.ID
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-Authored-by: Lorenzo Fontana <lo@linux.com>
2018-08-01 18:20:59 +02:00
Lorenzo Fontana 8f0ebe47f2
Static id from string function
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Chris Goller <goller@gmail.com>
2018-07-20 17:00:36 +02:00