From 717b08cefc3b7a49276eec89967e4579d2183b17 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Tue, 18 Sep 2018 12:14:42 +0100 Subject: [PATCH] versions: Update golang to 1.10.4 Move to golang version 1.10.4 -- the oldest stable golang release at the time of writing -- since golang 1.10+ is needed to make namespace handling safe. Re-ordered a couple of structs (moved `sync.WaitGroup` fields) to keep the `maligned` linter happy. Previously: `` virtcontainers/pkg/mock/cc_proxy_mock.go:24:18:warning: struct of size 160 could be 152 (maligned) virtcontainers/monitor.go:15:14:warning: struct of size 80 could be 72 (maligned) ``` See: - https://github.com/golang/go/issues/20676 - https://github.com/golang/go/commit/2595fe7fb6f272f9204ca3ef0b0c55e66fb8d90f Also bumped `languages.golang.meta.newest-version` to golang version 1.11, which is the newest stable release at the time of writing. Fixes #148. Signed-off-by: James O. D. Hunt --- versions.yaml | 4 ++-- virtcontainers/monitor.go | 2 +- virtcontainers/pkg/mock/cc_proxy_mock.go | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/versions.yaml b/versions.yaml index a79c2f8649..e9e79681e2 100644 --- a/versions.yaml +++ b/versions.yaml @@ -183,9 +183,9 @@ languages: golang: description: "Google's 'go' language" notes: "'version' is the default minimum version used by this project." - version: "1.9.7" + version: "1.10.4" meta: - newest-version: "1.10" + newest-version: "1.11" specs: description: "Details of important specifications" diff --git a/virtcontainers/monitor.go b/virtcontainers/monitor.go index fdf523a7d6..8e2a879746 100644 --- a/virtcontainers/monitor.go +++ b/virtcontainers/monitor.go @@ -18,9 +18,9 @@ type monitor struct { sandbox *Sandbox checkInterval time.Duration watchers []chan error + wg sync.WaitGroup running bool stopCh chan bool - wg sync.WaitGroup } func newMonitor(s *Sandbox) *monitor { diff --git a/virtcontainers/pkg/mock/cc_proxy_mock.go b/virtcontainers/pkg/mock/cc_proxy_mock.go index 052612ade8..23dd7f980d 100644 --- a/virtcontainers/pkg/mock/cc_proxy_mock.go +++ b/virtcontainers/pkg/mock/cc_proxy_mock.go @@ -25,7 +25,6 @@ type CCProxyMock struct { sync.Mutex t *testing.T - wg sync.WaitGroup connectionPath string // proxy socket @@ -44,6 +43,8 @@ type CCProxyMock struct { ShimDisconnected chan bool StdinReceived chan bool + wg sync.WaitGroup + stopped bool }