Skip to content

Commit

Permalink
refactor: rename method beforeEndTime => filterByTime
Browse files Browse the repository at this point in the history
  • Loading branch information
dbgeek committed Mar 3, 2019
1 parent 9d0815b commit ff1681a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion logworker/logworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (a *AccessLogFilter) AccesslogPath(prefix string) string {

}

func (a *AccessLogFilter) beforeEndTime(accessLog string) bool {
func (a *AccessLogFilter) filterByTime(accessLog string) bool {
accessLogEndTimeStr := strings.Split(accessLog, "_")[4]
accessLogEndTimeStamp, err := time.Parse("20060102T1504Z", accessLogEndTimeStr)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion logworker/logworker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestStartTimeEndTime(t *testing.T) {
accessLogFilter.StartTime = sTime
accessLogFilter.EndTime = eTime

if !accessLogFilter.beforeEndTime(tc.in) == tc.out {
if !accessLogFilter.filterByTime(tc.in) == tc.out {
t.Fatalf("startTime: %v, endTime: %v, accesslog timestamp: %v",
sTime.Format("20060102T15:04Z"),
eTime.Format("20060102T15:04Z"),
Expand Down

0 comments on commit ff1681a

Please sign in to comment.