Remove more unnecessarily named return values

This commit is contained in:
Tobias Schmidt 2017-02-28 17:33:46 -04:00
parent 5c28ab044d
commit 84eaa8fecd
4 changed files with 6 additions and 8 deletions

View File

@ -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")

View File

@ -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),

View File

@ -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

View File

@ -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