Skip to content

Commit

Permalink
lint fixes (struct alignment, unnecessary conversion)
Browse files Browse the repository at this point in the history
  • Loading branch information
dropwhile committed Feb 1, 2018
1 parent 6f8de71 commit 9d18382
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/go-camo/camo/encoding/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,5 @@ func DecodeURL(hmackey []byte, encdig string, encURL string) (string, bool) {
mlog.Debugf("Bad Decode of URL: %s", err)
return "", false
}
return string(urlBytes), true
return urlBytes, true
}
16 changes: 8 additions & 8 deletions src/go-camo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ func main() {

// command line flags
var opts struct {
HMACKey string `short:"k" long:"key" description:"HMAC key"`
Version []bool `short:"V" long:"version" description:"Print version and exit; specify twice to show license information"`
AddHeaders []string `short:"H" long:"header" description:"Extra header to return for each response. This option can be used multiple times to add multiple headers"`
Stats bool `long:"stats" description:"Enable Stats"`
NoLogTS bool `long:"no-log-ts" description:"Do not add a timestamp to logging"`
HMACKey string `short:"k" long:"key" description:"HMAC key"`
SSLKey string `long:"ssl-key" description:"ssl private key (key.pem) path"`
SSLCert string `long:"ssl-cert" description:"ssl cert (cert.pem) path"`
AllowList string `long:"allow-list" description:"Text file of hostname allow regexes (one per line)"`
BindAddress string `long:"listen" default:"0.0.0.0:8080" description:"Address:Port to bind to for HTTP"`
BindAddressSSL string `long:"ssl-listen" description:"Address:Port to bind to for HTTPS/SSL/TLS"`
MaxSize int64 `long:"max-size" default:"5120" description:"Max response image size (KB)"`
ReqTimeout time.Duration `long:"timeout" default:"4s" description:"Upstream request timeout"`
MaxRedirects int `long:"max-redirects" default:"3" description:"Maximum number of redirects to follow"`
Stats bool `long:"stats" description:"Enable Stats"`
NoLogTS bool `long:"no-log-ts" description:"Do not add a timestamp to logging"`
DisableKeepAlivesFE bool `long:"no-fk" description:"Disable frontend http keep-alive support"`
DisableKeepAlivesBE bool `long:"no-bk" description:"Disable backend http keep-alive support"`
BindAddress string `long:"listen" default:"0.0.0.0:8080" description:"Address:Port to bind to for HTTP"`
BindAddressSSL string `long:"ssl-listen" description:"Address:Port to bind to for HTTPS/SSL/TLS"`
SSLKey string `long:"ssl-key" description:"ssl private key (key.pem) path"`
SSLCert string `long:"ssl-cert" description:"ssl cert (cert.pem) path"`
Verbose bool `short:"v" long:"verbose" description:"Show verbose (debug) log level output"`
Version []bool `short:"V" long:"version" description:"Print version and exit; specify twice to show license information"`
}

// parse said flags
Expand Down
8 changes: 4 additions & 4 deletions src/go-camo/router/httpdate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/assert"
)

func TestiHTTPDateGoroutineUpdate(t *testing.T) {
func TestHTTPDateGoroutineUpdate(t *testing.T) {
t.Parallel()
d := newiHTTPDate()
n := d.String()
Expand All @@ -20,7 +20,7 @@ func TestiHTTPDateGoroutineUpdate(t *testing.T) {
assert.NotEqual(t, n, l, "Date did not update as expected: %s == %s", n, l)
}

func TestiHTTPDateManualUpdate(t *testing.T) {
func TestHTTPDateManualUpdate(t *testing.T) {
t.Parallel()
d := &iHTTPDate{}
d.Update()
Expand All @@ -31,7 +31,7 @@ func TestiHTTPDateManualUpdate(t *testing.T) {
assert.NotEqual(t, n, l, "Date did not update as expected: %s == %s", n, l)
}

func TestiHTTPDateManualUpdateUninitialized(t *testing.T) {
func TestHTTPDateManualUpdateUninitialized(t *testing.T) {
t.Parallel()
d := &iHTTPDate{}

Expand All @@ -47,7 +47,7 @@ func BenchmarkDataString(b *testing.B) {
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
d.String()
_ = d.String()
}
})
}

0 comments on commit 9d18382

Please sign in to comment.