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

@ -40,7 +40,7 @@ func gostring(b []int8) string {
}
// Expose filesystem fullness.
func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
func (c *filesystemCollector) GetStats() ([]filesystemStats, error) {
buf := make([]unix.Statfs_t, 16)
for {
n, err := unix.Getfsstat(buf, noWait)
@ -53,7 +53,7 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
}
buf = make([]unix.Statfs_t, len(buf)*2)
}
stats = []filesystemStats{}
stats := []filesystemStats{}
for _, fs := range buf {
mountpoint := gostring(fs.Mntonname[:])
if c.ignoredMountPointsPattern.MatchString(mountpoint) {