Remove unnecessarily named return variables
Named return variables should only be used to describe the returned type further, e.g. `err error` doesn't add any new information and is just stutter.
This commit is contained in:
parent
084e585c2a
commit
922e74d58f
32 changed files with 54 additions and 56 deletions
|
|
@ -71,16 +71,17 @@ func NewMegaCliCollector() (Collector, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (c *megaCliCollector) Update(ch chan<- prometheus.Metric) (err error) {
|
||||
err = c.updateAdapter()
|
||||
if err != nil {
|
||||
func (c *megaCliCollector) Update(ch chan<- prometheus.Metric) error {
|
||||
if err := c.updateAdapter(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := c.updateDisks(); err != nil {
|
||||
return err
|
||||
}
|
||||
err = c.updateDisks()
|
||||
c.driveTemperature.Collect(ch)
|
||||
c.driveCounters.Collect(ch)
|
||||
c.drivePresence.Collect(ch)
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
func parseMegaCliDisks(r io.Reader) (map[int]map[int]map[string]string, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue