From 14396c9092c45fc527499d1cc0de5d1668929404 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Mon, 2 Nov 2015 08:02:25 -0800 Subject: [PATCH] Fix golint warnings Signed-off-by: Alexander Morozov --- devicemapper/devmapper_wrapper_deferred_remove.go | 2 +- mflag/flag.go | 2 +- stringid/stringid.go | 2 +- tarsum/tarsum.go | 2 +- tlsconfig/config.go | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/devicemapper/devmapper_wrapper_deferred_remove.go b/devicemapper/devmapper_wrapper_deferred_remove.go index 40ab199..dc361ea 100644 --- a/devicemapper/devmapper_wrapper_deferred_remove.go +++ b/devicemapper/devmapper_wrapper_deferred_remove.go @@ -8,7 +8,7 @@ package devicemapper */ import "C" -// LibraryDeferredRemovalsupport is supported when statically linked. +// LibraryDeferredRemovalSupport is supported when statically linked. const LibraryDeferredRemovalSupport = true func dmTaskDeferredRemoveFct(task *cdmTask) int { diff --git a/mflag/flag.go b/mflag/flag.go index afab4c9..6a113b9 100644 --- a/mflag/flag.go +++ b/mflag/flag.go @@ -589,7 +589,7 @@ var Usage = func() { 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. var ShortUsage = func() { fmt.Fprintf(CommandLine.output, "Usage of %s:\n", os.Args[0]) diff --git a/stringid/stringid.go b/stringid/stringid.go index ab1f9d4..266a74b 100644 --- a/stringid/stringid.go +++ b/stringid/stringid.go @@ -34,7 +34,7 @@ func TruncateID(id string) string { func generateID(crypto bool) string { b := make([]byte, 32) - var r io.Reader = random.Reader + r := random.Reader if crypto { r = rand.Reader } diff --git a/tarsum/tarsum.go b/tarsum/tarsum.go index d2df58c..0f5783b 100644 --- a/tarsum/tarsum.go +++ b/tarsum/tarsum.go @@ -146,7 +146,7 @@ var ( } ) -// TarSum default is "sha256" +// DefaultTHash is default TarSum hashing algoritm - "sha256". var DefaultTHash = NewTHash("sha256", sha256.New) type simpleTHash struct { diff --git a/tlsconfig/config.go b/tlsconfig/config.go index 9f7f336..e3dfad1 100644 --- a/tlsconfig/config.go +++ b/tlsconfig/config.go @@ -47,8 +47,9 @@ var clientCipherSuites = []uint16{ tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, } -// For use by code which already has a crypto/tls options struct but wants to -// use a commonly accepted set of TLS cipher suites, with known weak algorithms removed +// DefaultServerAcceptedCiphers should be uses by code which already has a crypto/tls +// options struct but wants to use a commonly accepted set of TLS cipher suites, with +// known weak algorithms removed. var DefaultServerAcceptedCiphers = append(clientCipherSuites, acceptedCBCCiphers...) // ServerDefault is a secure-enough TLS configuration for the server TLS configuration.