mirror of
https://github.com/kataras/iris.git
synced 2025-12-22 04:17:03 +00:00
new accesslog middleware: require the writer inside its constructor so we can 'detect' if we must force-lock a writer
relative to: https://github.com/kataras/iris/issues/1601
This commit is contained in:
@@ -15,11 +15,14 @@ func TestAccessLogPrint_Simple(t *testing.T) {
|
||||
const goroutinesN = 42
|
||||
|
||||
w := new(bytes.Buffer)
|
||||
ac := New()
|
||||
ac.Writer = w
|
||||
ac.LockWriter = true
|
||||
ac := New(w)
|
||||
ac.TimeFormat = "2006-01-02 15:04:05"
|
||||
ac.Clock = TClock(time.Time{})
|
||||
|
||||
if !ac.LockWriter { // should be true because we register a *bytes.Buffer.
|
||||
t.Fatalf("expected LockRriter to be true")
|
||||
}
|
||||
|
||||
var (
|
||||
expected string
|
||||
wg = new(sync.WaitGroup)
|
||||
|
||||
Reference in New Issue
Block a user