From b112bdd52d30141815e9862c1be9b5eb8f78b248 Mon Sep 17 00:00:00 2001
From: Pierre Souchay
Date: Mon, 9 Jul 2018 23:02:03 +0200
Subject: [PATCH 1/3] Fixed compilation warning about wrong type
It fixes the following warnings:
agent/config/builder.go:1201: Errorf format %q has arg s of wrong type *string
agent/config/builder.go:1240: Errorf format %q has arg s of wrong type *string
---
agent/config/builder.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/agent/config/builder.go b/agent/config/builder.go
index b3fdb64741..63d5dbe8dd 100644
--- a/agent/config/builder.go
+++ b/agent/config/builder.go
@@ -1198,7 +1198,7 @@ func (b *Builder) expandAddrs(name string, s *string) []net.Addr {
x, err := template.Parse(*s)
if err != nil {
- b.err = multierror.Append(b.err, fmt.Errorf("%s: error parsing %q: %s", name, s, err))
+ b.err = multierror.Append(b.err, fmt.Errorf("%s: error parsing %s: %s", name, *s, err))
return nil
}
@@ -1237,7 +1237,7 @@ func (b *Builder) expandOptionalAddrs(name string, s *string) []string {
x, err := template.Parse(*s)
if err != nil {
- b.err = multierror.Append(b.err, fmt.Errorf("%s: error parsing %q: %s", name, s, err))
+ b.err = multierror.Append(b.err, fmt.Errorf("%s: error parsing %s: %s", name, *s, err))
return nil
}
From 2f760198477f8bbe308aaa4c18ec2206fb6562dc Mon Sep 17 00:00:00 2001
From: Pierre Souchay
Date: Tue, 10 Jul 2018 11:04:25 +0200
Subject: [PATCH 2/3] Fixed message: testutil/server.go:317: missing ... in
args forwarded to print-like function
---
testutil/server.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testutil/server.go b/testutil/server.go
index 8bbeca0e43..32d458a7fe 100644
--- a/testutil/server.go
+++ b/testutil/server.go
@@ -314,7 +314,7 @@ type failer struct {
failed bool
}
-func (f *failer) Log(args ...interface{}) { fmt.Println(args) }
+func (f *failer) Log(args ...interface{}) { fmt.Println(args...) }
func (f *failer) FailNow() { f.failed = true }
// waitForAPI waits for only the agent HTTP endpoint to start
From 7d2e4b77ec8155449f5fbd6f64e256beec99d324 Mon Sep 17 00:00:00 2001
From: Pierre Souchay
Date: Tue, 10 Jul 2018 16:52:08 +0200
Subject: [PATCH 3/3] Use %q, not %s as it used to
---
agent/config/builder.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/agent/config/builder.go b/agent/config/builder.go
index 63d5dbe8dd..e7958056e1 100644
--- a/agent/config/builder.go
+++ b/agent/config/builder.go
@@ -1198,7 +1198,7 @@ func (b *Builder) expandAddrs(name string, s *string) []net.Addr {
x, err := template.Parse(*s)
if err != nil {
- b.err = multierror.Append(b.err, fmt.Errorf("%s: error parsing %s: %s", name, *s, err))
+ b.err = multierror.Append(b.err, fmt.Errorf("%s: error parsing %q: %s", name, *s, err))
return nil
}
@@ -1237,7 +1237,7 @@ func (b *Builder) expandOptionalAddrs(name string, s *string) []string {
x, err := template.Parse(*s)
if err != nil {
- b.err = multierror.Append(b.err, fmt.Errorf("%s: error parsing %s: %s", name, *s, err))
+ b.err = multierror.Append(b.err, fmt.Errorf("%s: error parsing %q: %s", name, *s, err))
return nil
}