From e634bc9fab938d83b128358f82eced686c605686 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Ruel Date: Mon, 25 Jun 2018 21:24:54 -0400 Subject: [PATCH] Fix a ton of golint messages. The remainder is ALL_CAPS, underscores and golint confusion when multiple exported variables are defined on a single line. No functional change except one error string tweaked. --- devices/bmxx80/bmx280_test.go | 2 +- devices/bmxx80/bmxx80.go | 4 +--- experimental/devices/cap1188/cap1188_options.go | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/devices/bmxx80/bmx280_test.go b/devices/bmxx80/bmx280_test.go index 63e2752..bc17382 100644 --- a/devices/bmxx80/bmx280_test.go +++ b/devices/bmxx80/bmx280_test.go @@ -931,7 +931,7 @@ func BenchmarkCalibration280Float64(b *testing.B) { // -var epsilon float64 = 0.000000001 +const epsilon = 0.000000001 func floatEqual(a, b float64) bool { return (a-b) < epsilon && (b-a) < epsilon diff --git a/devices/bmxx80/bmxx80.go b/devices/bmxx80/bmxx80.go index 0e04587..94d1873 100644 --- a/devices/bmxx80/bmxx80.go +++ b/devices/bmxx80/bmxx80.go @@ -125,9 +125,7 @@ const ( F16 Filter = 4 ) -// DefaultsOpts returns the default options used. -// -// Defaults to use O4x (4x oversampling) for all measurements. +// DefaultOpts is the recommended default options. var DefaultOpts = Opts{ Temperature: O4x, Pressure: O4x, diff --git a/experimental/devices/cap1188/cap1188_options.go b/experimental/devices/cap1188/cap1188_options.go index 5aeec9e..e72d80f 100644 --- a/experimental/devices/cap1188/cap1188_options.go +++ b/experimental/devices/cap1188/cap1188_options.go @@ -13,6 +13,7 @@ import ( // SamplingTime determines the time to make a single sample. type SamplingTime uint8 +// Valid SamplingTime values. const ( S320us SamplingTime = 0 S640us SamplingTime = 1 @@ -24,6 +25,7 @@ const ( // AvgSampling set the number of samples per measurement that get averaged. type AvgSampling uint8 +// Valid AvgSampling values. const ( // Avg1 means that 1 sample is taken per measurement Avg1 AvgSampling = iota // 0 @@ -40,7 +42,7 @@ const ( // normal operation. type CycleTime uint8 -// Possible cycle time values. (written as 2 bits) +// Valid CycleTime values. const ( C35ms CycleTime = iota // 0 C70ms // default @@ -52,7 +54,7 @@ const ( // recalibration. type MaxDur uint8 -// Possible touch duration values. (written as 4 bits) +// Valid MaxDur values. const ( MaxDur560ms MaxDur = iota MaxDur840ms