From 7abb5ac69ec29eac02d0a81901465fb8f10b867e Mon Sep 17 00:00:00 2001 From: Marc-Antoine Ruel Date: Sun, 13 May 2018 20:44:43 -0400 Subject: [PATCH] conn/physic: redo the package that was added in 0bc4d173ac558fb5c2c It realized I did it wrong. Decouple and disambiguate the 'measurement type' from the 'unit used'. While trying to micro-optimize for 32 bits architecture, I missed the greater picture. Use int64 for most types. Include 100% test coverage and examples. --- devices/units.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/devices/units.go b/devices/units.go index 56eb8a3..f29dc28 100644 --- a/devices/units.go +++ b/devices/units.go @@ -10,7 +10,7 @@ import ( // Milli is a fixed point value with 0.001 precision. // -// Deprecated: This interface will be removed in v3. Use physic.Milli instead. +// Deprecated: This interface will be removed in v3. type Milli int32 // Float64 returns the value as float64 with 0.001 precision. @@ -29,7 +29,7 @@ func (m Milli) String() string { // Celsius is a temperature at a precision of 0.001°C. // -// Deprecated: This interface will be removed in v3. Use physic.Celsius +// Deprecated: This interface will be removed in v3. Use physic.Temperature // instead. type Celsius Milli @@ -50,7 +50,7 @@ func (c Celsius) ToF() Fahrenheit { // Fahrenheit is an unsound unit used in the United States. // -// Deprecated: This interface will be removed in v3. Use physic.Fahrenheit +// Deprecated: This interface will be removed in v3. Use physic.Temperature // instead. type Fahrenheit Milli @@ -66,7 +66,7 @@ func (f Fahrenheit) String() string { // KPascal is pressure at precision of 1Pa. // -// Deprecated: This interface will be removed in v3. Use physic.KPascal +// Deprecated: This interface will be removed in v3. Use physic.Pressure // instead. type KPascal Milli