Skip to content

Commit 62a2b3a

Browse files
authored
Merge pull request #152 from kzys/gofmt
Run gofmt on BuildKite
2 parents dbf9a1e + c4ebff8 commit 62a2b3a

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

.buildkite/pipeline.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ steps:
3333
# multiple go builds are downloading to the same cache.
3434
- wait
3535

36+
- label: gofmt -s
37+
command: test -z $(gofmt -s -l .)
38+
3639
- label: 'git log validation'
3740
command: './.buildkite/logcheck.sh'
3841

drives.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,28 @@ func (b DrivesBuilder) Build() []models.Drive {
6666

6767
// WithDriveID sets the ID of the drive
6868
func WithDriveID(id string) DriveOpt {
69-
return func(d *models.Drive) {
69+
return func(d *models.Drive) {
7070
d.DriveID = String(id)
7171
}
7272
}
7373

7474
// WithReadOnly sets the drive read-only
7575
func WithReadOnly(flag bool) DriveOpt {
76-
return func(d *models.Drive) {
76+
return func(d *models.Drive) {
7777
d.IsReadOnly = Bool(flag)
7878
}
7979
}
8080

8181
// WithPartuuid sets the unique ID of the boot partition
8282
func WithPartuuid(uuid string) DriveOpt {
83-
return func(d *models.Drive) {
83+
return func(d *models.Drive) {
8484
d.Partuuid = uuid
8585
}
8686
}
87+
8788
// WithRateLimiter sets the rate limitter of the drive
8889
func WithRateLimiter(limiter models.RateLimiter) DriveOpt {
89-
return func(d *models.Drive) {
90+
return func(d *models.Drive) {
9091
d.RateLimiter = &limiter
9192
}
92-
}
93+
}

machine_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func TestJailerMicroVMExecution(t *testing.T) {
167167
HtEnabled: Bool(false),
168168
},
169169
Drives: []models.Drive{
170-
models.Drive{
170+
{
171171
DriveID: String("1"),
172172
IsRootDevice: Bool(true),
173173
IsReadOnly: Bool(false),
@@ -705,7 +705,7 @@ func TestLogFiles(t *testing.T) {
705705
Debug: true,
706706
KernelImagePath: filepath.Join(testDataPath, "vmlinux"), SocketPath: filepath.Join(testDataPath, "socket-path"),
707707
Drives: []models.Drive{
708-
models.Drive{
708+
{
709709
DriveID: String("0"),
710710
IsRootDevice: Bool(true),
711711
IsReadOnly: Bool(false),
@@ -898,7 +898,7 @@ func TestPID(t *testing.T) {
898898
HtEnabled: Bool(false),
899899
},
900900
Drives: []models.Drive{
901-
models.Drive{
901+
{
902902
DriveID: String("1"),
903903
IsRootDevice: Bool(true),
904904
IsReadOnly: Bool(false),

network_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ func TestNetworkInterfacesValidation_CNI(t *testing.T) {
153153

154154
func TestNetworkInterfacesValidation_MultipleStatic(t *testing.T) {
155155
err := NetworkInterfaces([]NetworkInterface{
156-
NetworkInterface{
156+
{
157157
StaticConfiguration: &StaticNetworkConfiguration{
158158
MacAddress: mockMacAddrString,
159159
HostDevName: tapName,
160160
},
161161
},
162-
NetworkInterface{
162+
{
163163
StaticConfiguration: &StaticNetworkConfiguration{
164164
MacAddress: "11:22:33:44:55:66",
165165
HostDevName: "tap1",
@@ -172,7 +172,7 @@ func TestNetworkInterfacesValidation_MultipleStatic(t *testing.T) {
172172
func TestNetworkInterfacesValidationFails_MultipleCNI(t *testing.T) {
173173
err := NetworkInterfaces([]NetworkInterface{
174174
validCNIInterface,
175-
NetworkInterface{
175+
{
176176
CNIConfiguration: &CNIConfiguration{
177177
NetworkName: "something-else",
178178
netNSPath: "/a/different/netns",
@@ -185,7 +185,7 @@ func TestNetworkInterfacesValidationFails_MultipleCNI(t *testing.T) {
185185
func TestNetworkInterfacesValidationFails_IPWithMultiple(t *testing.T) {
186186
err := NetworkInterfaces([]NetworkInterface{
187187
validStaticNetworkInterface,
188-
NetworkInterface{
188+
{
189189
StaticConfiguration: &StaticNetworkConfiguration{
190190
MacAddress: "11:22:33:44:55:66",
191191
HostDevName: "tap1",
@@ -205,7 +205,7 @@ func TestNetworkInterfacesValidationFails_IPWithKernelArg(t *testing.T) {
205205
func TestNetworkInterfacesValidationFails_CNIWithMultiple(t *testing.T) {
206206
err := NetworkInterfaces([]NetworkInterface{
207207
validCNIInterface,
208-
NetworkInterface{
208+
{
209209
StaticConfiguration: &StaticNetworkConfiguration{
210210
MacAddress: "11:22:33:44:55:66",
211211
HostDevName: "tap1",
@@ -367,7 +367,7 @@ func startCNIMachine(t *testing.T,
367367
HtEnabled: Bool(true),
368368
},
369369
Drives: []models.Drive{
370-
models.Drive{
370+
{
371371
DriveID: String("1"),
372372
IsRootDevice: Bool(true),
373373
IsReadOnly: Bool(false),

0 commit comments

Comments
 (0)