golint fixes.

This commit is contained in:
Kyle Isom 2015-12-23 13:28:04 -08:00
parent 14bf511195
commit 215d03bdb1
5 changed files with 9 additions and 7 deletions

View File

@ -74,7 +74,7 @@ func displayName(name pkix.Name) string {
func keyUsages(ku x509.KeyUsage) string { func keyUsages(ku x509.KeyUsage) string {
var uses []string var uses []string
for u, s := range KeyUsage { for u, s := range keyUsage {
if (ku & u) != 0 { if (ku & u) != 0 {
uses = append(uses, s) uses = append(uses, s)
} }
@ -86,7 +86,7 @@ func keyUsages(ku x509.KeyUsage) string {
func extUsage(ext []x509.ExtKeyUsage) string { func extUsage(ext []x509.ExtKeyUsage) string {
ns := make([]string, 0, len(ext)) ns := make([]string, 0, len(ext))
for i := range ext { for i := range ext {
ns = append(ns, ExtKeyUsages[ext[i]]) ns = append(ns, extKeyUsages[ext[i]])
} }
return strings.Join(ns, ", ") return strings.Join(ns, ", ")

View File

@ -13,7 +13,8 @@ import (
// following two lifted from CFSSL, (replace-regexp "\(.+\): \(.+\)," // following two lifted from CFSSL, (replace-regexp "\(.+\): \(.+\),"
// "\2: \1,") // "\2: \1,")
var KeyUsage = map[x509.KeyUsage]string{
var keyUsage = map[x509.KeyUsage]string{
x509.KeyUsageDigitalSignature: "digital signature", x509.KeyUsageDigitalSignature: "digital signature",
x509.KeyUsageContentCommitment: "content committment", x509.KeyUsageContentCommitment: "content committment",
x509.KeyUsageKeyEncipherment: "key encipherment", x509.KeyUsageKeyEncipherment: "key encipherment",
@ -25,7 +26,7 @@ var KeyUsage = map[x509.KeyUsage]string{
x509.KeyUsageDecipherOnly: "decipher only", x509.KeyUsageDecipherOnly: "decipher only",
} }
var ExtKeyUsages = map[x509.ExtKeyUsage]string{ var extKeyUsages = map[x509.ExtKeyUsage]string{
x509.ExtKeyUsageAny: "any", x509.ExtKeyUsageAny: "any",
x509.ExtKeyUsageServerAuth: "server auth", x509.ExtKeyUsageServerAuth: "server auth",
x509.ExtKeyUsageClientAuth: "client auth", x509.ExtKeyUsageClientAuth: "client auth",

View File

@ -80,6 +80,7 @@ var levelPrefix = [...]string{
LevelFatal: "[FATAL] ", LevelFatal: "[FATAL] ",
} }
// DateFormat contains the default date format string used by the logger.
var DateFormat = "2006-01-02T15:03:04-0700" var DateFormat = "2006-01-02T15:03:04-0700"
func (l *Logger) outputf(level Level, format string, v []interface{}) { func (l *Logger) outputf(level Level, format string, v []interface{}) {

View File

@ -174,7 +174,7 @@ func New(domain string, level Level) (l *Logger, registered bool) {
return l, false return l, false
} }
// NewWriters returns a new logger that writes to the w io.WriteCloser // NewFromWriters returns a new logger that writes to the w io.WriteCloser
// for Notice and below and to the e io.WriteCloser for levels above // for Notice and below and to the e io.WriteCloser for levels above
// Notice. If e is nil, w will be used. If a logger with the same // Notice. If e is nil, w will be used. If a logger with the same
// domain exists, the logger will set its level to level and return // domain exists, the logger will set its level to level and return
@ -210,7 +210,7 @@ func NewFromWriters(domain string, level Level, w, e io.WriteCloser) (l *Logger,
return l, false return l, false
} }
// NewFile returns a new logger that opens the files for writing. If // NewFromFile returns a new logger that opens the files for writing. If
// multiplex is true, output will be multiplexed to standard output // multiplex is true, output will be multiplexed to standard output
// and standard error as well. // and standard error as well.
func NewFromFile(domain string, level Level, outFile, errFile string, multiplex bool, flags int) (*Logger, error) { func NewFromFile(domain string, level Level, outFile, errFile string, multiplex bool, flags int) (*Logger, error) {

View File

@ -33,7 +33,7 @@ func (t *mwc) Close() error {
return nil return nil
} }
// MultiWriteClose creates a WriteCloser that duplicates its writes to // MultiWriteCloser creates a WriteCloser that duplicates its writes to
// all the provided writers, similar to the Unix tee(1) command. // all the provided writers, similar to the Unix tee(1) command.
func MultiWriteCloser(wc ...io.WriteCloser) io.WriteCloser { func MultiWriteCloser(wc ...io.WriteCloser) io.WriteCloser {
wcs := make([]io.WriteCloser, len(wc)) wcs := make([]io.WriteCloser, len(wc))