Merge pull request #17614 from LK4D4/fix_golint
Update linting tools to latest versions
This commit is contained in:
commit
9f0f24ea63
6 changed files with 20 additions and 16 deletions
|
@ -31,6 +31,18 @@ const (
|
||||||
ChangeDelete
|
ChangeDelete
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (c ChangeType) String() string {
|
||||||
|
switch c {
|
||||||
|
case ChangeModify:
|
||||||
|
return "C"
|
||||||
|
case ChangeAdd:
|
||||||
|
return "A"
|
||||||
|
case ChangeDelete:
|
||||||
|
return "D"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// Change represents a change, it wraps the change type and path.
|
// Change represents a change, it wraps the change type and path.
|
||||||
// It describes changes of the files in the path respect to the
|
// It describes changes of the files in the path respect to the
|
||||||
// parent layers. The change could be modify, add, delete.
|
// parent layers. The change could be modify, add, delete.
|
||||||
|
@ -41,16 +53,7 @@ type Change struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (change *Change) String() string {
|
func (change *Change) String() string {
|
||||||
var kind string
|
return fmt.Sprintf("%s %s", change.Kind, change.Path)
|
||||||
switch change.Kind {
|
|
||||||
case ChangeModify:
|
|
||||||
kind = "C"
|
|
||||||
case ChangeAdd:
|
|
||||||
kind = "A"
|
|
||||||
case ChangeDelete:
|
|
||||||
kind = "D"
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("%s %s", kind, change.Path)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// for sort.Sort
|
// for sort.Sort
|
||||||
|
|
|
@ -8,7 +8,7 @@ package devicemapper
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
// LibraryDeferredRemovalsupport is supported when statically linked.
|
// LibraryDeferredRemovalSupport is supported when statically linked.
|
||||||
const LibraryDeferredRemovalSupport = true
|
const LibraryDeferredRemovalSupport = true
|
||||||
|
|
||||||
func dmTaskDeferredRemoveFct(task *cdmTask) int {
|
func dmTaskDeferredRemoveFct(task *cdmTask) int {
|
||||||
|
|
|
@ -589,7 +589,7 @@ var Usage = func() {
|
||||||
PrintDefaults()
|
PrintDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Usage prints to standard error a usage message documenting the standard command layout
|
// ShortUsage prints to standard error a usage message documenting the standard command layout
|
||||||
// The function is a variable that may be changed to point to a custom function.
|
// The function is a variable that may be changed to point to a custom function.
|
||||||
var ShortUsage = func() {
|
var ShortUsage = func() {
|
||||||
fmt.Fprintf(CommandLine.output, "Usage of %s:\n", os.Args[0])
|
fmt.Fprintf(CommandLine.output, "Usage of %s:\n", os.Args[0])
|
||||||
|
|
|
@ -34,7 +34,7 @@ func TruncateID(id string) string {
|
||||||
|
|
||||||
func generateID(crypto bool) string {
|
func generateID(crypto bool) string {
|
||||||
b := make([]byte, 32)
|
b := make([]byte, 32)
|
||||||
var r io.Reader = random.Reader
|
r := random.Reader
|
||||||
if crypto {
|
if crypto {
|
||||||
r = rand.Reader
|
r = rand.Reader
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ var (
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// TarSum default is "sha256"
|
// DefaultTHash is default TarSum hashing algoritm - "sha256".
|
||||||
var DefaultTHash = NewTHash("sha256", sha256.New)
|
var DefaultTHash = NewTHash("sha256", sha256.New)
|
||||||
|
|
||||||
type simpleTHash struct {
|
type simpleTHash struct {
|
||||||
|
|
|
@ -47,8 +47,9 @@ var clientCipherSuites = []uint16{
|
||||||
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
|
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
|
||||||
}
|
}
|
||||||
|
|
||||||
// For use by code which already has a crypto/tls options struct but wants to
|
// DefaultServerAcceptedCiphers should be uses by code which already has a crypto/tls
|
||||||
// use a commonly accepted set of TLS cipher suites, with known weak algorithms removed
|
// options struct but wants to use a commonly accepted set of TLS cipher suites, with
|
||||||
|
// known weak algorithms removed.
|
||||||
var DefaultServerAcceptedCiphers = append(clientCipherSuites, acceptedCBCCiphers...)
|
var DefaultServerAcceptedCiphers = append(clientCipherSuites, acceptedCBCCiphers...)
|
||||||
|
|
||||||
// ServerDefault is a secure-enough TLS configuration for the server TLS configuration.
|
// ServerDefault is a secure-enough TLS configuration for the server TLS configuration.
|
||||||
|
|
Loading…
Reference in a new issue