Passed
Push — master ( 3df1d0...111a66 )
by Serhii
02:56 queued 01:25
created

tests/helpers.go   A

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
cc 2
eloc 6
dl 0
loc 12
ccs 2
cts 2
cp 1
crap 2
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tests.smallSubTime 0 2 1
A tests.bigSubTime 0 2 1
1
package tests
2
3
import "time"
4
5
// test helper
6
func smallSubTime(d time.Duration) string {
7 1
	return time.Now().Add(d).Format("2006-01-02 15:04:05")
8
}
9
10
// test helper
11
func bigSubTime(years int, months int, days int) string {
12 1
	return time.Now().AddDate(-years, -months, -days).Format("2006-01-02 15:04:05")
13
}
14