Skip to content

Commit

Permalink
satisfy go vet
Browse files Browse the repository at this point in the history
  • Loading branch information
onsi committed May 27, 2021
1 parent 8f2dfbf commit 52990e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions gmeasure/enum_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions gmeasure/measurement.go
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down
4 changes: 2 additions & 2 deletions gmeasure/rank.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions gmeasure/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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().
Expand Down

0 comments on commit 52990e3

Please sign in to comment.