clean(all): gocritic warnings cleanup
This commit is contained in:
@@ -44,5 +44,6 @@ func cliRouter(commands ...string) {
|
||||
switch commands[0] {
|
||||
case "users":
|
||||
cliExecUsers(commands[1:]...)
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,6 +159,7 @@ func (b recordReportBuilder) Cast(row sqlx.ColScanner) map[string]interface{} {
|
||||
switch cv := v.(type) {
|
||||
case []uint8:
|
||||
out[k] = string(cv)
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
jwtVerifier (func(http.Handler) http.Handler)
|
||||
jwtAuthenticator (func(http.Handler) http.Handler)
|
||||
jwtVerifier func(http.Handler) http.Handler
|
||||
jwtAuthenticator func(http.Handler) http.Handler
|
||||
jwtEncoder auth.TokenEncoder
|
||||
)
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ func (*Social) Init(prefix ...string) *Social {
|
||||
}
|
||||
|
||||
social = new(Social)
|
||||
flag.BoolVar(&social.Enabled, "auth-social-enabled", true, "SocialAuth enabled")
|
||||
flag.BoolVar(&social.Enabled, "auth-social-enabled", false, "SocialAuth enabled")
|
||||
|
||||
b("Facebook", &social.FacebookKey, &social.FacebookSecret)
|
||||
b("GPlus", &social.GPlusKey, &social.GPlusSecret)
|
||||
|
||||
@@ -26,7 +26,7 @@ type Downloadable interface {
|
||||
func NewAttachmentDownloadable(ah AttachmentAPI) *Attachment {
|
||||
serve := func(f interface{}, err error, w http.ResponseWriter, r *http.Request) {
|
||||
if err != nil {
|
||||
switch true {
|
||||
switch {
|
||||
// @todo: compare concrete exported error type? Go2 .As() like check?
|
||||
case err.Error() == "crust.messaging.repository.AttachmentNotFound":
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
|
||||
@@ -47,7 +47,7 @@ func (svc *event) Message(m *types.Message) error {
|
||||
func (svc *event) MessageFlag(f *types.MessageFlag) error {
|
||||
var p outgoing.MessageEncoder
|
||||
|
||||
switch true {
|
||||
switch {
|
||||
case f.IsBookmark():
|
||||
// Leaving this here so it is obvious.
|
||||
return nil
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
jwtVerifier (func(http.Handler) http.Handler)
|
||||
jwtAuthenticator (func(http.Handler) http.Handler)
|
||||
jwtVerifier func(http.Handler) http.Handler
|
||||
jwtAuthenticator func(http.Handler) http.Handler
|
||||
jwtEncoder auth.TokenEncoder
|
||||
)
|
||||
|
||||
|
||||
@@ -186,6 +186,7 @@ func (r *user) prepare(user *types.User, fields ...string) (err error) {
|
||||
}
|
||||
user.Teams = teams
|
||||
}
|
||||
default:
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
jwtVerifier (func(http.Handler) http.Handler)
|
||||
jwtAuthenticator (func(http.Handler) http.Handler)
|
||||
jwtVerifier func(http.Handler) http.Handler
|
||||
jwtAuthenticator func(http.Handler) http.Handler
|
||||
jwtEncoder auth.TokenEncoder
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user