From fadf8bbdff4e4f92e87e64a3027b29436ae66585 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 16 Apr 2021 16:28:10 +0200 Subject: [PATCH] staticcheck: SA4001: &*x will be simplified to x. It will not copy x daemon/volumes_unix_test.go:228:13: SA4001: &*x will be simplified to x. It will not copy x. (staticcheck) mp: &(*c.MountPoints["/jambolan"]), // copy the mountpoint, expect no changes ^ daemon/logger/local/local_test.go:214:22: SA4001: &*x will be simplified to x. It will not copy x. (staticcheck) dst.PLogMetaData = &(*src.PLogMetaData) ^ Signed-off-by: Sebastiaan van Stijn (cherry picked from commit f7433d6190cb716b6d748b4e87c607dffb7161fb) Signed-off-by: Sebastiaan van Stijn --- daemon/logger/local/local_test.go | 3 ++- daemon/volumes_unix_test.go | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/daemon/logger/local/local_test.go b/daemon/logger/local/local_test.go index 21ea8e6a82..d59a17df4f 100644 --- a/daemon/logger/local/local_test.go +++ b/daemon/logger/local/local_test.go @@ -211,7 +211,8 @@ func copyLogMessage(src *logger.Message) *logger.Message { dst.Err = src.Err dst.Line = append(dst.Line, src.Line...) if src.PLogMetaData != nil { - dst.PLogMetaData = &(*src.PLogMetaData) + lmd := *src.PLogMetaData + dst.PLogMetaData = &lmd } return dst } diff --git a/daemon/volumes_unix_test.go b/daemon/volumes_unix_test.go index 4515dfb49f..a566d19b4a 100644 --- a/daemon/volumes_unix_test.go +++ b/daemon/volumes_unix_test.go @@ -97,6 +97,8 @@ func TestBackportMountSpec(t *testing.T) { return string(b) } + mpc := *c.MountPoints["/jambolan"] + for _, x := range []expected{ { mp: &volumemounts.MountPoint{ @@ -226,7 +228,7 @@ func TestBackportMountSpec(t *testing.T) { comment: "partially configured named volume caused by #32613", }, { - mp: &(*c.MountPoints["/jambolan"]), // copy the mountpoint, expect no changes + mp: &mpc, comment: "volume defined in mounts API", }, {