From 3d798aa4a1b7bd5b7add82fd14ae51f9757ed0d8 Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Sat, 27 Oct 2018 03:18:33 -0400 Subject: [PATCH] collector: fix golint problems in ZFS collector (#1132) Signed-off-by: Matt Layher --- collector/zfs_linux.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/collector/zfs_linux.go b/collector/zfs_linux.go index 0d1ba7c..ae80650 100644 --- a/collector/zfs_linux.go +++ b/collector/zfs_linux.go @@ -29,14 +29,14 @@ import ( // constants from https://github.com/zfsonlinux/zfs/blob/master/lib/libspl/include/sys/kstat.h // kept as strings for comparison thus avoiding conversion to int const ( - KSTAT_DATA_CHAR = "0" - KSTAT_DATA_INT32 = "1" - KSTAT_DATA_UINT32 = "2" - KSTAT_DATA_INT64 = "3" - KSTAT_DATA_UINT64 = "4" - KSTAT_DATA_LONG = "5" - KSTAT_DATA_ULONG = "6" - KSTAT_DATA_STRING = "7" + kstatDataChar = "0" + kstatDataInt32 = "1" + kstatDataUint32 = "2" + kstatDataInt64 = "3" + kstatDataUint64 = "4" + kstatDataLong = "5" + kstatDataUlong = "6" + kstatDataString = "7" ) func (c *zfsCollector) openProcFile(path string) (*os.File, error) { @@ -112,7 +112,7 @@ func (c *zfsCollector) parseProcfsFile(reader io.Reader, fmtExt string, handler // kstat data type (column 2) should be KSTAT_DATA_UINT64, otherwise ignore // TODO: when other KSTAT_DATA_* types arrive, much of this will need to be restructured - if parts[1] == KSTAT_DATA_UINT64 { + if parts[1] == kstatDataUint64 { key := fmt.Sprintf("kstat.zfs.misc.%s.%s", fmtExt, parts[0]) value, err := strconv.ParseUint(parts[2], 10, 64) if err != nil {