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:
Tobias Schmidt 2017-02-28 14:47:20 -04:00
commit 922e74d58f
32 changed files with 54 additions and 56 deletions

View file

@ -116,12 +116,12 @@ func NewNfsCollector() (Collector, error) {
return &nfsCollector{}, nil
}
func (c *nfsCollector) Update(ch chan<- prometheus.Metric) (err error) {
func (c *nfsCollector) Update(ch chan<- prometheus.Metric) error {
statsFile := procFilePath("net/rpc/nfs")
content, err := ioutil.ReadFile(statsFile)
if err != nil {
if os.IsNotExist(err) {
log.Debugf("Not collecting NFS statistics, as %s does not exist: %s", statsFile)
log.Debugf("Not collecting NFS statistics, as %q does not exist", statsFile)
return nil
}
return err