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

tests.smallSubTime   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
nop 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