Commit Graph

20 Commits (d65a980f9b782a6aea414fa8ef8f9b2adba852a6)

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 166db0755b chore(id): update error comments for ids 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 5db4276a71 fix(platform/id): improvements on code using uint64 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
Leonardo Di Donato 5d786eb579 fix(platform/id): remove first and last char during unmarshalling only if they are quotes 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 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 ae9e7c0087 Adapt tests to ID generators returning pointer to platform.ID 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 94f48bdaf5 Switch ID back to uint64 2018-08-01 18:20:59 +02:00
Leonardo Di Donato 60eb7dd8ad Errors for shorter and longer inputs + empty function + big endian
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2018-08-01 18:20:59 +02:00
Leonardo Di Donato d2a11aa77c Platform ID encoding using uint64
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
Michael Desa 1aa08a2a4b fix(platform): rename *_generator.go to *.go 2018-05-16 11:45:13 -04:00