[gotidy] Tidy source code
This commit was generated by running `gotidy -w .`
Change-Id: I13292112467fb6a802940d835d065ef33f595f14
diff --git a/cache/cache.go b/cache/cache.go
index 8d99e1c..b502be0 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -18,7 +18,7 @@
Get(key Key) (interface{}, bool)
// Check if a key exsists in cache.
- Contains(key Key) (bool)
+ Contains(key Key) bool
// Removes a key from the cache.
Remove(key Key) interface{}
diff --git a/cmd/botanist/zedboot.go b/cmd/botanist/zedboot.go
index 41a6bfd..6198e20 100644
--- a/cmd/botanist/zedboot.go
+++ b/cmd/botanist/zedboot.go
@@ -236,7 +236,6 @@
return err
}
-
// Boot fuchsia.
var bootMode int
if cmd.netboot {
diff --git a/cmd/debroot/main.go b/cmd/debroot/main.go
index 2fd29fa..b4b0e2e 100644
--- a/cmd/debroot/main.go
+++ b/cmd/debroot/main.go
@@ -392,7 +392,7 @@
}
// Ensure that we don't have duplicate file names that only differ in case.
- type rename struct { oldpath, newpath string }
+ type rename struct{ oldpath, newpath string }
renames := []rename{}
for _, d := range []string{"usr/include/linux"} {
@@ -423,7 +423,7 @@
for i, p := range ps {
if i > 0 {
ext := filepath.Ext(p)
- renames = append(renames, rename{ p, p[:len(p)-len(ext)] + strings.Repeat("_", i) + ext })
+ renames = append(renames, rename{p, p[:len(p)-len(ext)] + strings.Repeat("_", i) + ext})
}
}
}
diff --git a/cmd/dev_finder/list.go b/cmd/dev_finder/list.go
index 4e93a4e..28bc049 100644
--- a/cmd/dev_finder/list.go
+++ b/cmd/dev_finder/list.go
@@ -1,3 +1,7 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
package main
import (
diff --git a/cmd/mdnstool/main.go b/cmd/mdnstool/main.go
index 7a2e1da..e6f5762 100644
--- a/cmd/mdnstool/main.go
+++ b/cmd/mdnstool/main.go
@@ -1,3 +1,7 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
package main
import (
diff --git a/cmd/testrunner/output.go b/cmd/testrunner/output.go
index 5370965..86bb335 100644
--- a/cmd/testrunner/output.go
+++ b/cmd/testrunner/output.go
@@ -84,8 +84,8 @@
// AddFile registers a file on disk as a file to include in the summary.
func (o *SummaryOutput) AddFile(name, path string) {
- if o.Summary.Outputs == nil {
- o.Summary.Outputs = make(map[string]string)
- }
- o.Summary.Outputs[name] = path
+ if o.Summary.Outputs == nil {
+ o.Summary.Outputs = make(map[string]string)
+ }
+ o.Summary.Outputs[name] = path
}
diff --git a/digest/digest_test.go b/digest/digest_test.go
index 5e61865..8607a48 100644
--- a/digest/digest_test.go
+++ b/digest/digest_test.go
@@ -9,14 +9,14 @@
)
var c = &credentials{
- username: "admin",
- realm: "Digest:4C1F0000000000000000000000000000",
- nonce: "GZHoABAHAAAAAAAAtejSfCEQLbW+c/fM",
- uri: "/index",
- algorithm: "MD5",
- qop: "auth",
- method: "POST",
- password: "password",
+ username: "admin",
+ realm: "Digest:4C1F0000000000000000000000000000",
+ nonce: "GZHoABAHAAAAAAAAtejSfCEQLbW+c/fM",
+ uri: "/index",
+ algorithm: "MD5",
+ qop: "auth",
+ method: "POST",
+ password: "password",
}
var cnonce = "0a4f113b"
diff --git a/mdns/mdns.go b/mdns/mdns.go
index eff713c..7233b9a 100644
--- a/mdns/mdns.go
+++ b/mdns/mdns.go
@@ -1,3 +1,7 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
package mdns
import (
diff --git a/mdns/mdns_test.go b/mdns/mdns_test.go
index 8832eb8..9d574c7 100644
--- a/mdns/mdns_test.go
+++ b/mdns/mdns_test.go
@@ -1,3 +1,7 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
package mdns
import (
diff --git a/resultstore/mocks/proto_mocks.go b/resultstore/mocks/proto_mocks.go
index a9ea6f8..d17e5d1 100644
--- a/resultstore/mocks/proto_mocks.go
+++ b/resultstore/mocks/proto_mocks.go
@@ -1,3 +1,7 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
// Code generated by MockGen. DO NOT EDIT.
// Source: google.golang.org/genproto/googleapis/devtools/resultstore/v2 (interfaces: ResultStoreUploadClient)
diff --git a/retry/backoff.go b/retry/backoff.go
index 978f91b..be30888 100644
--- a/retry/backoff.go
+++ b/retry/backoff.go
@@ -33,6 +33,7 @@
}
func (b *ConstantBackoff) Reset() {}
+
func (b *ConstantBackoff) Next() time.Duration { return b.interval }
func NewConstantBackoff(d time.Duration) *ConstantBackoff {
@@ -40,7 +41,7 @@
}
type maxTriesBackoff struct {
- backOff Backoff
+ backOff Backoff
maxTries uint64
numTries uint64
}
diff --git a/serial/serial_linux.go b/serial/serial_linux.go
index a93db9e..22e7e17 100644
--- a/serial/serial_linux.go
+++ b/serial/serial_linux.go
@@ -13,7 +13,7 @@
"golang.org/x/sys/unix"
)
-var supportedBaudRates = map[int]uint32 {
+var supportedBaudRates = map[int]uint32{
50: unix.B50,
75: unix.B75,
110: unix.B110,
@@ -51,7 +51,7 @@
if !ok {
return nil, fmt.Errorf("unsupported baud rate: %d", baudRate)
}
- if timeoutSecs < 0 || (timeoutSecs * 10) > (1 << 8) {
+ if timeoutSecs < 0 || (timeoutSecs*10) > (1<<8) {
return nil, fmt.Errorf("timeout must be between 0 and 25, got: %d", timeoutSecs)
}
f, err := os.OpenFile(name, unix.O_RDWR|unix.O_NOCTTY|unix.O_NONBLOCK, 0666)
@@ -59,12 +59,12 @@
return nil, err
}
t := unix.Termios{
- Iflag: unix.IGNPAR,
- Cflag: unix.CREAD|unix.CLOCAL|unix.CS8|rate,
+ Iflag: unix.IGNPAR,
+ Cflag: unix.CREAD | unix.CLOCAL | unix.CS8 | rate,
Ispeed: rate,
Ospeed: rate,
}
- t.Cc[unix.VTIME] = uint8(timeoutSecs*10)
+ t.Cc[unix.VTIME] = uint8(timeoutSecs * 10)
_, _, errno := unix.Syscall6(
unix.SYS_IOCTL,
uintptr(f.Fd()),
diff --git a/testrunner/result.go b/testrunner/result.go
index 6753176..66a7acf 100644
--- a/testrunner/result.go
+++ b/testrunner/result.go
@@ -1,3 +1,7 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
package testrunner
import (
diff --git a/testrunner/ssh_runner.go b/testrunner/ssh_runner.go
index 2feea9c..b30193b 100644
--- a/testrunner/ssh_runner.go
+++ b/testrunner/ssh_runner.go
@@ -1,3 +1,7 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
package testrunner
import (
diff --git a/testrunner/tests.go b/testrunner/tests.go
index 9d6de37..dc4cd2a 100644
--- a/testrunner/tests.go
+++ b/testrunner/tests.go
@@ -1,3 +1,7 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
package testrunner
import (
diff --git a/tftp/tftp.go b/tftp/tftp.go
index dbbf244..6d5399f 100644
--- a/tftp/tftp.go
+++ b/tftp/tftp.go
@@ -38,15 +38,15 @@
)
const (
- ErrorUndefined = uint16(0) // Not defined, see error message (if any)
- ErrorFileNotFound = uint16(1) // File not found
- ErrorAccessViolation = uint16(2) // Access violation
- ErrorDiskFull = uint16(3) // Disk full or allocation exceeded
- ErrorIllegalOperation = uint16(4) // Illegal TFTP operation
- ErrorUnknownID = uint16(5) // Unknown transfer ID
- ErrorFileExists = uint16(6) // File already exists
- ErrorNoSuchUser = uint16(7) // No such user
- ErrorBadOptions = uint16(8) // Bad options
+ ErrorUndefined = uint16(0) // Not defined, see error message (if any)
+ ErrorFileNotFound = uint16(1) // File not found
+ ErrorAccessViolation = uint16(2) // Access violation
+ ErrorDiskFull = uint16(3) // Disk full or allocation exceeded
+ ErrorIllegalOperation = uint16(4) // Illegal TFTP operation
+ ErrorUnknownID = uint16(5) // Unknown transfer ID
+ ErrorFileExists = uint16(6) // File already exists
+ ErrorNoSuchUser = uint16(7) // No such user
+ ErrorBadOptions = uint16(8) // Bad options
// ErrorBusy is a Fuchsia-specific extension to the set of TFTP error
// codes, meant to indicate that the server cannot currently handle a