From 768c3b18888db50f848481e713106e655fba6df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 22 Oct 2021 18:22:07 +0300 Subject: [PATCH] [mem][solaris] don't hardcode path to prtconf in error message --- mem/mem_solaris.go | 3 +-- v3/mem/mem_solaris.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mem/mem_solaris.go b/mem/mem_solaris.go index 4cacde1..0c27bd0 100644 --- a/mem/mem_solaris.go +++ b/mem/mem_solaris.go @@ -4,7 +4,6 @@ package mem import ( "context" - "errors" "fmt" "os/exec" "regexp" @@ -84,7 +83,7 @@ func globalZoneMemoryCapacity() (uint64, error) { match := globalZoneMemoryCapacityMatch.FindAllStringSubmatch(string(out), -1) if len(match) != 1 { - return 0, errors.New("memory size not contained in output of /usr/sbin/prtconf") + return 0, fmt.Errorf("memory size not contained in output of %q", prtconf) } totalMB, err := strconv.ParseUint(match[0][1], 10, 64) diff --git a/v3/mem/mem_solaris.go b/v3/mem/mem_solaris.go index 99f5975..91831d4 100644 --- a/v3/mem/mem_solaris.go +++ b/v3/mem/mem_solaris.go @@ -4,7 +4,6 @@ package mem import ( "context" - "errors" "fmt" "os/exec" "regexp" @@ -84,7 +83,7 @@ func globalZoneMemoryCapacity() (uint64, error) { match := globalZoneMemoryCapacityMatch.FindAllStringSubmatch(string(out), -1) if len(match) != 1 { - return 0, errors.New("memory size not contained in output of /usr/sbin/prtconf") + return 0, fmt.Errorf("memory size not contained in output of %q", prtconf) } totalMB, err := strconv.ParseUint(match[0][1], 10, 64)