chore: update linter.
This commit is contained in:
parent
da1c9f48b7
commit
f54136b602
12 changed files with 63 additions and 8 deletions
|
@ -683,6 +683,8 @@ func TestNewLogHandlerOutputStdout(t *testing.T) {
|
|||
}
|
||||
|
||||
func assertValidLogData(t *testing.T, expected string, logData []byte) {
|
||||
t.Helper()
|
||||
|
||||
if len(expected) == 0 {
|
||||
assert.Zero(t, len(logData))
|
||||
t.Log(string(logData))
|
||||
|
@ -716,6 +718,8 @@ func assertValidLogData(t *testing.T, expected string, logData []byte) {
|
|||
}
|
||||
|
||||
func captureStdout(t *testing.T) (out *os.File, restoreStdout func()) {
|
||||
t.Helper()
|
||||
|
||||
file, err := ioutil.TempFile("", "testlogger")
|
||||
require.NoError(t, err, "failed to create temp file")
|
||||
|
||||
|
@ -731,6 +735,8 @@ func captureStdout(t *testing.T) (out *os.File, restoreStdout func()) {
|
|||
}
|
||||
|
||||
func createTempDir(t *testing.T, prefix string) string {
|
||||
t.Helper()
|
||||
|
||||
tmpDir, err := ioutil.TempDir("", prefix)
|
||||
require.NoError(t, err, "failed to create temp dir")
|
||||
|
||||
|
@ -740,6 +746,8 @@ func createTempDir(t *testing.T, prefix string) string {
|
|||
}
|
||||
|
||||
func doLoggingTLSOpt(t *testing.T, config *types.AccessLog, enableTLS bool) {
|
||||
t.Helper()
|
||||
|
||||
logger, err := NewHandler(config)
|
||||
require.NoError(t, err)
|
||||
defer logger.Close()
|
||||
|
@ -771,10 +779,14 @@ func doLoggingTLSOpt(t *testing.T, config *types.AccessLog, enableTLS bool) {
|
|||
}
|
||||
|
||||
func doLoggingTLS(t *testing.T, config *types.AccessLog) {
|
||||
t.Helper()
|
||||
|
||||
doLoggingTLSOpt(t, config, true)
|
||||
}
|
||||
|
||||
func doLogging(t *testing.T, config *types.AccessLog) {
|
||||
t.Helper()
|
||||
|
||||
doLoggingTLSOpt(t, config, false)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue