From 92e8d9b91a753dcb0ae2e67f55d491b654e2b8bc Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 8 Jun 2021 10:51:41 -0700 Subject: [PATCH] libct/intelrdt: error message nits An errror from ioutil.WriteFile already contains file name, so there is no need to duplicate that information. Signed-off-by: Kir Kolyshkin --- libcontainer/intelrdt/intelrdt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/intelrdt/intelrdt.go b/libcontainer/intelrdt/intelrdt.go index 3fa11b800..cd6e7bf75 100644 --- a/libcontainer/intelrdt/intelrdt.go +++ b/libcontainer/intelrdt/intelrdt.go @@ -414,7 +414,7 @@ func writeFile(dir, file, data string) error { return fmt.Errorf("no such directory for %s", file) } if err := ioutil.WriteFile(filepath.Join(dir, file), []byte(data+"\n"), 0o600); err != nil { - return fmt.Errorf("failed to write %v to %v: %v", data, file, err) + return fmt.Errorf("failed to write %v: %v", data, err) } return nil } @@ -521,7 +521,7 @@ func WriteIntelRdtTasks(dir string, pid int) error { // Don't attach any pid if -1 is specified as a pid if pid != -1 { if err := ioutil.WriteFile(filepath.Join(dir, IntelRdtTasks), []byte(strconv.Itoa(pid)), 0o600); err != nil { - return fmt.Errorf("failed to write %v to %v: %v", pid, IntelRdtTasks, err) + return fmt.Errorf("failed to write %v: %v", pid, err) } } return nil