fix: update linter.
This commit is contained in:
parent
027d313df5
commit
29efac3e5e
52 changed files with 17 additions and 89 deletions
|
@ -45,7 +45,6 @@ func AddServiceFields(rw http.ResponseWriter, req *http.Request, next http.Handl
|
|||
data.Core[ServiceAddr] = req.URL.Host
|
||||
|
||||
next.ServeHTTP(rw, req)
|
||||
|
||||
}
|
||||
|
||||
// AddOriginFields add origin fields
|
||||
|
|
|
@ -69,8 +69,8 @@ func toLog(fields logrus.Fields, key string, defaultValue string, quoted bool) i
|
|||
return v
|
||||
}
|
||||
}
|
||||
return defaultValue
|
||||
|
||||
return defaultValue
|
||||
}
|
||||
|
||||
func toLogEntry(s string, defaultValue string, quote bool) string {
|
||||
|
|
|
@ -99,11 +99,9 @@ func TestCommonLogFormatter_Format(t *testing.T) {
|
|||
assert.Equal(t, test.expectedLog, string(raw))
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func Test_toLog(t *testing.T) {
|
||||
|
||||
testCases := []struct {
|
||||
desc string
|
||||
fields logrus.Fields
|
||||
|
|
|
@ -527,7 +527,6 @@ func TestNewLogHandlerOutputStdout(t *testing.T) {
|
|||
for _, test := range testCases {
|
||||
test := test
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
|
||||
// NOTE: It is not possible to run these cases in parallel because we capture Stdout
|
||||
|
||||
file, restoreStdout := captureStdout(t)
|
||||
|
@ -543,7 +542,6 @@ func TestNewLogHandlerOutputStdout(t *testing.T) {
|
|||
}
|
||||
|
||||
func assertValidLogData(t *testing.T, expected string, logData []byte) {
|
||||
|
||||
if len(expected) == 0 {
|
||||
assert.Zero(t, len(logData))
|
||||
t.Log(string(logData))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue