@@ -154,17 +154,17 @@ func TestFilterLogEntries(t *testing.T) {
154
154
},
155
155
"filter out old entries" : {
156
156
logs : []string {
157
- fmt .Sprintf (`{"message":"old2", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , time . Now () .Add (- 2 * time .Second ).Format (timeStampFormat )),
158
- fmt .Sprintf (`{"message":"old1", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , time . Now () .Add (- 1 * time .Second ).Format (timeStampFormat )),
159
- fmt .Sprintf (`{"message":"now", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , time . Now () .Format (timeStampFormat )),
160
- fmt .Sprintf (`{"message":"new1", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , time . Now () .Add (1 * time .Second ).Format (timeStampFormat )),
161
- fmt .Sprintf (`{"message":"new2", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , time . Now () .Add (2 * time .Second ).Format (timeStampFormat )),
157
+ fmt .Sprintf (`{"message":"old2", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , now .Add (- 2 * time .Second ).Format (timeStampFormat )),
158
+ fmt .Sprintf (`{"message":"old1", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , now .Add (- 1 * time .Second ).Format (timeStampFormat )),
159
+ fmt .Sprintf (`{"message":"now", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , now .Format (timeStampFormat )),
160
+ fmt .Sprintf (`{"message":"new1", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , now .Add (1 * time .Second ).Format (timeStampFormat )),
161
+ fmt .Sprintf (`{"message":"new2", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , now .Add (2 * time .Second ).Format (timeStampFormat )),
162
162
},
163
163
pluginID : "some.plugin.id" ,
164
164
since : now ,
165
165
expectedLogs : []string {
166
- fmt .Sprintf (`{"message":"new1", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , time . Now () .Add (1 * time .Second ).Format (timeStampFormat )),
167
- fmt .Sprintf (`{"message":"new2", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , time . Now () .Add (2 * time .Second ).Format (timeStampFormat )),
166
+ fmt .Sprintf (`{"message":"new1", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , now .Add (1 * time .Second ).Format (timeStampFormat )),
167
+ fmt .Sprintf (`{"message":"new2", "plugin_id": "some.plugin.id", "timestamp": "%s"}` , now .Add (2 * time .Second ).Format (timeStampFormat )),
168
168
},
169
169
expectedErr : false ,
170
170
},
0 commit comments