Skip to content

Commit 73dc99a

Browse files
committed
gofmt with go 1.19
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent f977c9e commit 73dc99a

77 files changed

Lines changed: 186 additions & 183 deletions

Some content is hidden

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

agent/exec/controller_test.go

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 20 additions & 22 deletions
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.

0 commit comments

Comments
 (0)