diff options
author | Tobias Schmidt <tobidt@gmail.com> | 2017-02-28 14:47:20 -0400 |
---|---|---|
committer | Tobias Schmidt <tobidt@gmail.com> | 2017-02-28 16:04:25 -0400 |
commit | 922e74d58fddd257cf9a0a323d95932c6a66a29a (patch) | |
tree | e07b23d009fad52d8757bb6a313c3b9fac07e2d8 /collector/filesystem_freebsd.go | |
parent | 084e585c2af0a886dad527dc67184a4e6bc10747 (diff) | |
download | prometheus_node_collector-922e74d58fddd257cf9a0a323d95932c6a66a29a.tar.bz2 prometheus_node_collector-922e74d58fddd257cf9a0a323d95932c6a66a29a.tar.xz prometheus_node_collector-922e74d58fddd257cf9a0a323d95932c6a66a29a.zip |
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.
Diffstat (limited to 'collector/filesystem_freebsd.go')
-rw-r--r-- | collector/filesystem_freebsd.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/collector/filesystem_freebsd.go b/collector/filesystem_freebsd.go index 0afdff4..0716716 100644 --- a/collector/filesystem_freebsd.go +++ b/collector/filesystem_freebsd.go | |||
@@ -40,7 +40,7 @@ func gostring(b []int8) string { | |||
40 | } | 40 | } |
41 | 41 | ||
42 | // Expose filesystem fullness. | 42 | // Expose filesystem fullness. |
43 | func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) { | 43 | func (c *filesystemCollector) GetStats() ([]filesystemStats, error) { |
44 | buf := make([]unix.Statfs_t, 16) | 44 | buf := make([]unix.Statfs_t, 16) |
45 | for { | 45 | for { |
46 | n, err := unix.Getfsstat(buf, noWait) | 46 | n, err := unix.Getfsstat(buf, noWait) |
@@ -53,7 +53,7 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) { | |||
53 | } | 53 | } |
54 | buf = make([]unix.Statfs_t, len(buf)*2) | 54 | buf = make([]unix.Statfs_t, len(buf)*2) |
55 | } | 55 | } |
56 | stats = []filesystemStats{} | 56 | stats := []filesystemStats{} |
57 | for _, fs := range buf { | 57 | for _, fs := range buf { |
58 | mountpoint := gostring(fs.Mntonname[:]) | 58 | mountpoint := gostring(fs.Mntonname[:]) |
59 | if c.ignoredMountPointsPattern.MatchString(mountpoint) { | 59 | if c.ignoredMountPointsPattern.MatchString(mountpoint) { |