From 52990e3608d3c05f0095d37a97e8ce8a438d9a38 Mon Sep 17 00:00:00 2001 From: Onsi Fakhouri Date: Wed, 26 May 2021 19:16:03 -0600 Subject: [PATCH] satisfy go vet --- gmeasure/enum_support.go | 4 ++-- gmeasure/measurement.go | 4 ++-- gmeasure/rank.go | 4 ++-- gmeasure/stats.go | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gmeasure/enum_support.go b/gmeasure/enum_support.go index 86a14180a..b5404f962 100644 --- a/gmeasure/enum_support.go +++ b/gmeasure/enum_support.go @@ -26,7 +26,7 @@ func (es enumSupport) String(e uint) string { return es.toString[e] } -func (es enumSupport) UnmarshalJSON(b []byte) (uint, error) { +func (es enumSupport) UnmarshJSON(b []byte) (uint, error) { var dec string if err := json.Unmarshal(b, &dec); err != nil { return 0, err @@ -35,7 +35,7 @@ func (es enumSupport) UnmarshalJSON(b []byte) (uint, error) { return out, nil } -func (es enumSupport) MarshalJSON(e uint) ([]byte, error) { +func (es enumSupport) MarshJSON(e uint) ([]byte, error) { if e == 0 || e > es.maxEnum { return json.Marshal(nil) } diff --git a/gmeasure/measurement.go b/gmeasure/measurement.go index 27bf8ae56..103d3ea9d 100644 --- a/gmeasure/measurement.go +++ b/gmeasure/measurement.go @@ -22,11 +22,11 @@ var letEnumSupport = newEnumSupport(map[uint]string{uint(MeasurementTypeInvalid) func (s MeasurementType) String() string { return letEnumSupport.String(uint(s)) } func (s *MeasurementType) UnmarshalJSON(b []byte) error { - out, err := letEnumSupport.UnmarshalJSON(b) + out, err := letEnumSupport.UnmarshJSON(b) *s = MeasurementType(out) return err } -func (s MeasurementType) MarshalJSON() ([]byte, error) { return letEnumSupport.MarshalJSON(uint(s)) } +func (s MeasurementType) MarshalJSON() ([]byte, error) { return letEnumSupport.MarshJSON(uint(s)) } /* Measurement records all captured data for a given measurement. You generally don't make Measurements directly - but you can fetch them from Experiments using Get(). diff --git a/gmeasure/rank.go b/gmeasure/rank.go index 5beee0fcd..1544cd8f4 100644 --- a/gmeasure/rank.go +++ b/gmeasure/rank.go @@ -27,11 +27,11 @@ var rcEnumSupport = newEnumSupport(map[uint]string{uint(LowerMeanIsBetter): "Low func (s RankingCriteria) String() string { return rcEnumSupport.String(uint(s)) } func (s *RankingCriteria) UnmarshalJSON(b []byte) error { - out, err := rcEnumSupport.UnmarshalJSON(b) + out, err := rcEnumSupport.UnmarshJSON(b) *s = RankingCriteria(out) return err } -func (s RankingCriteria) MarshalJSON() ([]byte, error) { return rcEnumSupport.MarshalJSON(uint(s)) } +func (s RankingCriteria) MarshalJSON() ([]byte, error) { return rcEnumSupport.MarshJSON(uint(s)) } /* Ranking ranks a set of Stats by a specified RankingCritera. Use RankStats to create a Ranking. diff --git a/gmeasure/stats.go b/gmeasure/stats.go index 18d501cd9..8c02e1bdf 100644 --- a/gmeasure/stats.go +++ b/gmeasure/stats.go @@ -25,11 +25,11 @@ var statEnumSupport = newEnumSupport(map[uint]string{uint(StatInvalid): "INVALID func (s Stat) String() string { return statEnumSupport.String(uint(s)) } func (s *Stat) UnmarshalJSON(b []byte) error { - out, err := statEnumSupport.UnmarshalJSON(b) + out, err := statEnumSupport.UnmarshJSON(b) *s = Stat(out) return err } -func (s Stat) MarshalJSON() ([]byte, error) { return statEnumSupport.MarshalJSON(uint(s)) } +func (s Stat) MarshalJSON() ([]byte, error) { return statEnumSupport.MarshJSON(uint(s)) } type StatsType uint @@ -43,11 +43,11 @@ var statsTypeEnumSupport = newEnumSupport(map[uint]string{uint(StatsTypeInvalid) func (s StatsType) String() string { return statsTypeEnumSupport.String(uint(s)) } func (s *StatsType) UnmarshalJSON(b []byte) error { - out, err := statsTypeEnumSupport.UnmarshalJSON(b) + out, err := statsTypeEnumSupport.UnmarshJSON(b) *s = StatsType(out) return err } -func (s StatsType) MarshalJSON() ([]byte, error) { return statsTypeEnumSupport.MarshalJSON(uint(s)) } +func (s StatsType) MarshalJSON() ([]byte, error) { return statsTypeEnumSupport.MarshJSON(uint(s)) } /* Stats records the key statistics for a given measurement. You generally don't make Stats directly - but you can fetch them from Experiments using GetStats() and from Measurements using Stats().