Skip to content

Commit 73dc99a

Browse files
committed
gofmt with go 1.19
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent f977c9e commit 73dc99a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+186
-183
lines changed

agent/exec/controller_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"runtime"
88
"testing"
99

10+
gogotypes "github.com/gogo/protobuf/types"
1011
"github.com/moby/swarmkit/v2/api"
1112
"github.com/moby/swarmkit/v2/log"
12-
gogotypes "github.com/gogo/protobuf/types"
1313
"github.com/stretchr/testify/assert"
1414
)
1515

agent/exec/dockerapi/adapter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
"github.com/docker/docker/api/types"
1212
"github.com/docker/docker/api/types/events"
1313
engineapi "github.com/docker/docker/client"
14+
gogotypes "github.com/gogo/protobuf/types"
1415
"github.com/moby/swarmkit/v2/agent/exec"
1516
"github.com/moby/swarmkit/v2/api"
1617
"github.com/moby/swarmkit/v2/log"
17-
gogotypes "github.com/gogo/protobuf/types"
1818
"github.com/pkg/errors"
1919
"github.com/sirupsen/logrus"
2020
"golang.org/x/time/rate"

agent/exec/dockerapi/container.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ import (
1717
"github.com/docker/docker/api/types/volume"
1818
"github.com/docker/go-connections/nat"
1919
"github.com/docker/go-units"
20+
gogotypes "github.com/gogo/protobuf/types"
2021
"github.com/moby/swarmkit/v2/agent/exec"
2122
"github.com/moby/swarmkit/v2/api"
2223
"github.com/moby/swarmkit/v2/api/genericresource"
2324
"github.com/moby/swarmkit/v2/api/naming"
2425
"github.com/moby/swarmkit/v2/template"
25-
gogotypes "github.com/gogo/protobuf/types"
2626
)
2727

2828
const (

agent/exec/dockerapi/container_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
enginemount "github.com/docker/docker/api/types/mount"
1010
"github.com/docker/docker/api/types/strslice"
1111
"github.com/docker/go-units"
12-
"github.com/moby/swarmkit/v2/api"
1312
gogotypes "github.com/gogo/protobuf/types"
13+
"github.com/moby/swarmkit/v2/api"
1414
)
1515

1616
func TestVolumesAndBinds(t *testing.T) {

agent/exec/dockerapi/controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import (
1515
"github.com/docker/docker/api/types/events"
1616
engineapi "github.com/docker/docker/client"
1717
"github.com/docker/go-connections/nat"
18+
gogotypes "github.com/gogo/protobuf/types"
1819
"github.com/moby/swarmkit/v2/agent/exec"
1920
"github.com/moby/swarmkit/v2/api"
2021
"github.com/moby/swarmkit/v2/log"
21-
gogotypes "github.com/gogo/protobuf/types"
2222
"github.com/pkg/errors"
2323
"golang.org/x/time/rate"
2424
)

agent/exec/dockerapi/controller_integration_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ func init() {
3030
// Run with something like this:
3131
//
3232
// go test -run TestControllerFlowIntegration -test.docker.addr unix:///var/run/docker.sock
33-
//
3433
func TestControllerFlowIntegration(t *testing.T) {
3534
if dockerTestAddr == "" {
3635
t.Skip("specify docker address to run integration")

agent/exec/dockerapi/controller_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import (
1616
containertypes "github.com/docker/docker/api/types/container"
1717
"github.com/docker/docker/api/types/events"
1818
"github.com/docker/docker/api/types/network"
19+
gogotypes "github.com/gogo/protobuf/types"
1920
"github.com/moby/swarmkit/v2/agent/exec"
2021
"github.com/moby/swarmkit/v2/api"
2122
"github.com/moby/swarmkit/v2/identity"
2223
"github.com/moby/swarmkit/v2/log"
23-
gogotypes "github.com/gogo/protobuf/types"
2424
"github.com/stretchr/testify/assert"
2525
)
2626

agent/storage.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package agent
22

33
import (
4-
"github.com/moby/swarmkit/v2/api"
54
"github.com/gogo/protobuf/proto"
5+
"github.com/moby/swarmkit/v2/api"
66
bolt "go.etcd.io/bbolt"
77
)
88

99
// Layout:
1010
//
11-
// bucket(v1.tasks.<id>) ->
12-
// data (task protobuf)
13-
// status (task status protobuf)
14-
// assigned (key present)
11+
// bucket(v1.tasks.<id>) ->
12+
// data (task protobuf)
13+
// status (task status protobuf)
14+
// assigned (key present)
1515
var (
1616
bucketKeyStorageVersion = []byte("v1")
1717
bucketKeyTasks = []byte("tasks")

api/defaults/service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package defaults
33
import (
44
"time"
55

6+
gogotypes "github.com/gogo/protobuf/types"
67
"github.com/moby/swarmkit/v2/api"
78
"github.com/moby/swarmkit/v2/api/deepcopy"
8-
gogotypes "github.com/gogo/protobuf/types"
99
)
1010

1111
// Service is a ServiceSpec object with all fields filled in using default

ca/certificates.go

+20-22
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ import (
3939

4040
const (
4141
// Security Strength Equivalence
42-
//-----------------------------------
43-
//| ECC | DH/DSA/RSA |
44-
//| 256 | 3072 |
45-
//| 384 | 7680 |
46-
//-----------------------------------
42+
//
43+
// | ECC | DH/DSA/RSA |
44+
// |----------|---------------|
45+
// | 256 | 3072 |
46+
// | 384 | 7680 |
4747

4848
// RootKeySize is the default size of the root CA key
4949
// It would be ideal for the root key to use P-384, but in P-384 is not optimized in go yet :(
@@ -134,25 +134,24 @@ type x509UnknownAuthError struct {
134134
//
135135
// Requirements:
136136
//
137-
// - [signing CA key] must be the private key for [signing CA cert], and either both or none must be provided
138-
//
139-
// - [intermediate CA1] must have the same public key and subject as [signing CA cert], because otherwise when
140-
// appended to a leaf certificate, the intermediates will not form a chain (because [intermediate CA1] won't because
141-
// the signer of the leaf certificate)
142-
// - [intermediate CA1] must be signed by [intermediate CA2], which must be signed by [intermediate CA3]
143-
//
144-
// - When we issue a certificate, the intermediates will be appended so that the certificate looks like:
145-
// [leaf signed by signing CA cert][intermediate CA1][intermediate CA2][intermediate CA3]
146-
// - [leaf signed by signing CA cert][intermediate CA1][intermediate CA2][intermediate CA3] is guaranteed to form a
147-
// valid chain from [leaf signed by signing CA cert] to one of the root certs ([signing CA cert], [CA cert1], [CA cert2])
148-
// using zero or more of the intermediate certs ([intermediate CA1][intermediate CA2][intermediate CA3]) as intermediates
137+
// - [signing CA key] must be the private key for [signing CA cert], and either both or none must be provided
138+
// - [intermediate CA1] must have the same public key and subject as [signing CA cert], because otherwise when
139+
// appended to a leaf certificate, the intermediates will not form a chain (because [intermediate CA1] won't because
140+
// the signer of the leaf certificate)
141+
// - [intermediate CA1] must be signed by [intermediate CA2], which must be signed by [intermediate CA3]
142+
// - When we issue a certificate, the intermediates will be appended so that the certificate looks like:
143+
// [leaf signed by signing CA cert][intermediate CA1][intermediate CA2][intermediate CA3]
144+
// - [leaf signed by signing CA cert][intermediate CA1][intermediate CA2][intermediate CA3] is guaranteed to form a
145+
// valid chain from [leaf signed by signing CA cert] to one of the root certs ([signing CA cert], [CA cert1], [CA cert2])
146+
// using zero or more of the intermediate certs ([intermediate CA1][intermediate CA2][intermediate CA3]) as intermediates
149147
//
150148
// Example 1: Simple root rotation
149+
//
151150
// - Initial state:
152-
// - RootCA.Cert: [Root CA1 self-signed]
153-
// - RootCA.Intermediates: []
154-
// - RootCA.signer.Cert: [Root CA1 self-signed]
155-
// - Issued TLS cert: [leaf signed by Root CA1]
151+
// - RootCA.Cert: [Root CA1 self-signed]
152+
// - RootCA.Intermediates: []
153+
// - RootCA.signer.Cert: [Root CA1 self-signed]
154+
// - Issued TLS cert: [leaf signed by Root CA1]
156155
//
157156
// - Intermediate state (during root rotation):
158157
// - RootCA.Cert: [Root CA1 self-signed]
@@ -165,7 +164,6 @@ type x509UnknownAuthError struct {
165164
// - RootCA.Intermediates: []
166165
// - RootCA.signer.Cert: [Root CA2 self-signed]
167166
// - Issued TLS cert: [leaf signed by Root CA2]
168-
//
169167
type RootCA struct {
170168
// Certs contains a bundle of self-signed, PEM encoded certificates for the Root CA to be used
171169
// as the root of trust.

ca/pkcs8/pkcs8.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// https://github.com/youmark/pkcs8 and modified function signatures to match
44
// signatures of crypto/x509 and cloudflare/cfssl/helpers to simplify package
55
// swapping. License for original package is as follow:
6-
//
6+
77
// The MIT License (MIT)
88
//
99
// Copyright (c) 2014 youmark
@@ -25,6 +25,7 @@
2525
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2626
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2727
// SOFTWARE.
28+
2829
package pkcs8
2930

3031
import (

ca/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import (
88
"sync"
99
"time"
1010

11+
gogotypes "github.com/gogo/protobuf/types"
1112
"github.com/moby/swarmkit/v2/api"
1213
"github.com/moby/swarmkit/v2/api/equality"
1314
"github.com/moby/swarmkit/v2/identity"
1415
"github.com/moby/swarmkit/v2/log"
1516
"github.com/moby/swarmkit/v2/manager/state/store"
16-
gogotypes "github.com/gogo/protobuf/types"
1717
"github.com/pkg/errors"
1818
"github.com/sirupsen/logrus"
1919
"google.golang.org/grpc/codes"

cmd/protoc-gen-gogoswarm/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package main
22

33
import (
4+
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
5+
"github.com/gogo/protobuf/vanity"
6+
"github.com/gogo/protobuf/vanity/command"
47
_ "github.com/moby/swarmkit/v2/protobuf/plugin/authenticatedwrapper"
58
_ "github.com/moby/swarmkit/v2/protobuf/plugin/deepcopy"
69
_ "github.com/moby/swarmkit/v2/protobuf/plugin/raftproxy"
710
_ "github.com/moby/swarmkit/v2/protobuf/plugin/storeobject"
8-
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
9-
"github.com/gogo/protobuf/vanity"
10-
"github.com/gogo/protobuf/vanity/command"
1111
)
1212

1313
func main() {

cmd/swarm-rafttool/dump.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"os"
88
"path/filepath"
99

10+
"github.com/gogo/protobuf/proto"
1011
"github.com/moby/swarmkit/v2/api"
1112
"github.com/moby/swarmkit/v2/manager/encryption"
1213
"github.com/moby/swarmkit/v2/manager/state/raft/storage"
1314
"github.com/moby/swarmkit/v2/manager/state/store"
14-
"github.com/gogo/protobuf/proto"
1515
"go.etcd.io/etcd/raft/v3/raftpb"
1616
"go.etcd.io/etcd/server/v3/etcdserver/api/snap"
1717
"go.etcd.io/etcd/server/v3/wal/walpb"

cmd/swarmctl/cluster/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"sort"
88
"text/tabwriter"
99

10+
gogotypes "github.com/gogo/protobuf/types"
1011
"github.com/moby/swarmkit/v2/api"
1112
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
12-
gogotypes "github.com/gogo/protobuf/types"
1313
"github.com/spf13/cobra"
1414
)
1515

cmd/swarmctl/cluster/update.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import (
66
"strings"
77
"time"
88

9+
gogotypes "github.com/gogo/protobuf/types"
910
"github.com/moby/swarmkit/v2/api"
1011
"github.com/moby/swarmkit/v2/cli"
1112
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
12-
gogotypes "github.com/gogo/protobuf/types"
1313
"github.com/spf13/cobra"
1414
)
1515

cmd/swarmctl/config/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"os"
77
"text/tabwriter"
88

9+
gogotypes "github.com/gogo/protobuf/types"
910
"github.com/moby/swarmkit/v2/api"
1011
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
11-
gogotypes "github.com/gogo/protobuf/types"
1212
"github.com/spf13/cobra"
1313
)
1414

cmd/swarmctl/config/list.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
"sort"
88
"text/tabwriter"
99

10-
"github.com/moby/swarmkit/v2/api"
11-
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
1210
"github.com/dustin/go-humanize"
1311
gogotypes "github.com/gogo/protobuf/types"
12+
"github.com/moby/swarmkit/v2/api"
13+
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
1414
"github.com/spf13/cobra"
1515
)
1616

cmd/swarmctl/node/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"sort"
88
"text/tabwriter"
99

10+
"github.com/dustin/go-humanize"
1011
"github.com/moby/swarmkit/v2/api"
1112
"github.com/moby/swarmkit/v2/api/genericresource"
1213
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
1314
"github.com/moby/swarmkit/v2/cmd/swarmctl/task"
14-
"github.com/dustin/go-humanize"
1515
"github.com/spf13/cobra"
1616
)
1717

cmd/swarmctl/secret/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"os"
77
"text/tabwriter"
88

9+
gogotypes "github.com/gogo/protobuf/types"
910
"github.com/moby/swarmkit/v2/api"
1011
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
11-
gogotypes "github.com/gogo/protobuf/types"
1212
"github.com/spf13/cobra"
1313
)
1414

cmd/swarmctl/secret/list.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
"sort"
88
"text/tabwriter"
99

10-
"github.com/moby/swarmkit/v2/api"
11-
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
1210
"github.com/dustin/go-humanize"
1311
gogotypes "github.com/gogo/protobuf/types"
12+
"github.com/moby/swarmkit/v2/api"
13+
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
1414
"github.com/spf13/cobra"
1515
)
1616

cmd/swarmctl/service/flagparser/container.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package flagparser
22

33
import (
4-
"github.com/moby/swarmkit/v2/api"
54
gogotypes "github.com/gogo/protobuf/types"
5+
"github.com/moby/swarmkit/v2/api"
66
"github.com/spf13/pflag"
77
)
88

cmd/swarmctl/service/flagparser/restart.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"time"
66

7-
"github.com/moby/swarmkit/v2/api"
87
gogotypes "github.com/gogo/protobuf/types"
8+
"github.com/moby/swarmkit/v2/api"
99
"github.com/spf13/pflag"
1010
)
1111

cmd/swarmctl/service/inspect.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
"strings"
1010
"text/tabwriter"
1111

12+
"github.com/dustin/go-humanize"
13+
gogotypes "github.com/gogo/protobuf/types"
1214
"github.com/moby/swarmkit/v2/api"
1315
"github.com/moby/swarmkit/v2/api/genericresource"
1416
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
1517
"github.com/moby/swarmkit/v2/cmd/swarmctl/task"
16-
"github.com/dustin/go-humanize"
17-
gogotypes "github.com/gogo/protobuf/types"
1818
"github.com/spf13/cobra"
1919
)
2020

cmd/swarmctl/task/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"strings"
99
"text/tabwriter"
1010

11+
gogotypes "github.com/gogo/protobuf/types"
1112
"github.com/moby/swarmkit/v2/api"
1213
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
13-
gogotypes "github.com/gogo/protobuf/types"
1414
"github.com/spf13/cobra"
1515
)
1616

cmd/swarmctl/task/print.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"sort"
77
"text/tabwriter"
88

9+
gogotypes "github.com/gogo/protobuf/types"
910
"github.com/moby/swarmkit/v2/api"
1011
"github.com/moby/swarmkit/v2/cmd/swarmctl/common"
11-
gogotypes "github.com/gogo/protobuf/types"
1212
)
1313

1414
type tasksBySlot []*api.Task

cmd/swarmd/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"os/signal"
1212

1313
engineapi "github.com/docker/docker/client"
14+
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
1415
"github.com/moby/swarmkit/v2/agent/exec/dockerapi"
1516
"github.com/moby/swarmkit/v2/api"
1617
"github.com/moby/swarmkit/v2/api/genericresource"
@@ -20,7 +21,6 @@ import (
2021
"github.com/moby/swarmkit/v2/manager/encryption"
2122
"github.com/moby/swarmkit/v2/node"
2223
"github.com/moby/swarmkit/v2/version"
23-
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
2424
"github.com/prometheus/client_golang/prometheus/promhttp"
2525
"github.com/sirupsen/logrus"
2626
"github.com/spf13/cobra"

0 commit comments

Comments
 (0)