From bc6597d155a7594247e14c7577ca28b9d9fca82a Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Mon, 19 Jun 2017 12:09:36 -0700 Subject: [PATCH 1/2] Fix message formatting errors Use the path string not the os.File object when formatting error messages. Fixes errors like these when building with go1.9: common/common.go: arg dir for printf verb %q of wrong type: *os.File Signed-off-by: Geoff Levand --- common/common.go | 4 ++-- rkt/run.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/common.go b/common/common.go index 5f4f4267db..1b2b9c410e 100644 --- a/common/common.go +++ b/common/common.go @@ -428,7 +428,7 @@ func PathSupportsOverlay(path string) error { dir, err := os.OpenFile(path, syscall.O_RDONLY|syscall.O_DIRECTORY, 0755) if err != nil { - return errwrap.Wrap(fmt.Errorf("cannot open %q", dir), err) + return errwrap.Wrap(fmt.Errorf("cannot open %q", path), err) } defer dir.Close() @@ -437,7 +437,7 @@ func PathSupportsOverlay(path string) error { // passing the buffer size. n, err := syscall.ReadDirent(int(dir.Fd()), buf) if err != nil { - return errwrap.Wrap(fmt.Errorf("cannot read directory %q", dir), err) + return errwrap.Wrap(fmt.Errorf("cannot read directory %q", path), err) } offset := 0 diff --git a/rkt/run.go b/rkt/run.go index 9fe9e7b1aa..e0b26041a6 100644 --- a/rkt/run.go +++ b/rkt/run.go @@ -553,10 +553,10 @@ func (e *envFileMap) Set(s string) error { pair := strings.SplitN(line, "=", 2) // Malformed lines if len(pair) != 2 || len(pair[0]) == 0 { - return fmt.Errorf("environment variable must be specified as name=value (file %q)", file) + return fmt.Errorf("environment variable must be specified as name=value (file %q)", s) } if _, exists := e.mapping[pair[0]]; exists { - return fmt.Errorf("environment variable %q already set (file %q)", pair[0], file) + return fmt.Errorf("environment variable %q already set (file %q)", pair[0], s) } e.mapping[pair[0]] = pair[1] } From 185fcc0135837971f5de3115c08ef5b92c30dd64 Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Mon, 19 Jun 2017 12:09:36 -0700 Subject: [PATCH 2/2] tests: Remove stale forward-vars This target no longer uses ABS_GO, so remove the forward-vars for it. Signed-off-by: Geoff Levand --- tests/functional.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/functional.mk b/tests/functional.mk index dc58d612cd..43f2941332 100644 --- a/tests/functional.mk +++ b/tests/functional.mk @@ -183,7 +183,6 @@ include makelib/build_go_bin.mk # 4 - manifest.json.in define FTST_GENERATE_ACE_IMAGE -$$(call forward-vars,$2/manifest,ABS_GO) $2/manifest: $4 | $2 $$(VQ) \ $$(call vb,v2,GEN,$$(call vsp,$$@)) \