Browse Source

Remove more unnecessarily named return values

pull/484/head
Tobias Schmidt 8 years ago
parent
commit
84eaa8fecd
  1. 2
      collector/devstat_dragonfly.go
  2. 6
      collector/exec_bsd.go
  3. 4
      collector/hwmon_linux.go
  4. 2
      collector/zfs_linux.go

2
collector/devstat_dragonfly.go

@ -124,7 +124,7 @@ func NewDevstatCollector() (Collector, error) {
}, nil
}
func (c *devstatCollector) Update(ch chan<- prometheus.Metric) (err error) {
func (c *devstatCollector) Update(ch chan<- prometheus.Metric) error {
count := C._get_ndevs()
if count == -1 {
return errors.New("getdevs() failed")

6
collector/exec_bsd.go

@ -28,7 +28,7 @@ func init() {
Factories["exec"] = NewExecCollector
}
// NewExecCollector returns a new Collector exposing system execution statistics
// NewExecCollector returns a new Collector exposing system execution statistics.
func NewExecCollector() (Collector, error) {
// From sys/vm/vm_meter.c:
// All are of type CTLTYPE_UINT.
@ -77,15 +77,13 @@ func NewExecCollector() (Collector, error) {
}
// Update pushes exec statistics onto ch
func (c *execCollector) Update(ch chan<- prometheus.Metric) (err error) {
func (c *execCollector) Update(ch chan<- prometheus.Metric) error {
for _, m := range c.sysctls {
v, err := m.Value()
if err != nil {
return err
}
// We "know" all of our sysctls are CounterValues, let's skip
// parsing them
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(Namespace, "exec", m.name),

4
collector/hwmon_linux.go

@ -101,7 +101,7 @@ func explodeSensorFilename(filename string) (ok bool, sensorType string, sensorN
return true, sensorType, sensorNum, sensorProperty
}
func collectSensorData(dir string, data map[string]map[string]string) (err error) {
func collectSensorData(dir string, data map[string]map[string]string) error {
sensorFiles, dirError := ioutil.ReadDir(dir)
if dirError != nil {
return dirError
@ -123,7 +123,7 @@ func collectSensorData(dir string, data map[string]map[string]string) (err error
return nil
}
func (c *hwMonCollector) updateHwmon(ch chan<- prometheus.Metric, dir string) (err error) {
func (c *hwMonCollector) updateHwmon(ch chan<- prometheus.Metric, dir string) error {
hwmonName, err := c.hwmonName(dir)
if err != nil {
return err

2
collector/zfs_linux.go

@ -47,7 +47,7 @@ func (c *zfsCollector) updateZfsStats(subsystem string, ch chan<- prometheus.Met
})
}
func (c *zfsCollector) updatePoolStats(ch chan<- prometheus.Metric) (err error) {
func (c *zfsCollector) updatePoolStats(ch chan<- prometheus.Metric) error {
zpoolPaths, err := filepath.Glob(procFilePath(filepath.Join(c.linuxProcpathBase, c.linuxZpoolIoPath)))
if err != nil {
return err

Loading…
Cancel
Save