From ab34aa25359b51337311d58f30aaad69d0c0c3b9 Mon Sep 17 00:00:00 2001 From: Rahul Gupta Date: Thu, 20 Jul 2023 14:30:34 +0530 Subject: [PATCH] fix: remove duplicate error message --- cmd/collectors/zapi/plugins/shelf/shelf.go | 2 +- cmd/collectors/zapiperf/plugins/disk/disk.go | 2 +- pkg/errs/errors.go | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/collectors/zapi/plugins/shelf/shelf.go b/cmd/collectors/zapi/plugins/shelf/shelf.go index 69a1ee0d3..82d0ba319 100644 --- a/cmd/collectors/zapi/plugins/shelf/shelf.go +++ b/cmd/collectors/zapi/plugins/shelf/shelf.go @@ -56,7 +56,7 @@ func (my *Shelf) Init() error { objects := my.Params.GetChildS("objects") if objects == nil { - return errs.New(errs.ErrMissingParams, "objects") + return errs.New(errs.ErrMissingParam, "objects") } for _, obj := range objects.GetChildren() { diff --git a/cmd/collectors/zapiperf/plugins/disk/disk.go b/cmd/collectors/zapiperf/plugins/disk/disk.go index 942eaec60..37f43bea1 100644 --- a/cmd/collectors/zapiperf/plugins/disk/disk.go +++ b/cmd/collectors/zapiperf/plugins/disk/disk.go @@ -135,7 +135,7 @@ func (d *Disk) Init() error { objects := d.Params.GetChildS("objects") if objects == nil { - return errs.New(errs.ErrMissingParams, "objects") + return errs.New(errs.ErrMissingParam, "objects") } for _, obj := range objects.GetChildren() { diff --git a/pkg/errs/errors.go b/pkg/errs/errors.go index 2ff1104c0..40046e418 100644 --- a/pkg/errs/errors.go +++ b/pkg/errs/errors.go @@ -23,7 +23,6 @@ const ( ErrInvalidItem = harvestError("invalid item") ErrInvalidParam = harvestError("invalid parameter") ErrMissingParam = harvestError("missing parameter") - ErrMissingParams = harvestError("missing parameter") ErrNoCollector = harvestError("no collectors") ErrNoInstance = harvestError("no instances") ErrNoMetric = harvestError("no metrics")