push
github
0 of 2 new or added lines in 2 files covered. (0.0%)
4 existing lines in 2 files now uncovered.8859 of 19942 relevant lines covered (44.42%)
0.5 hits per line
1 |
package template
|
|
2 |
|
|
3 |
import "time" |
|
4 |
|
|
5 |
func hour() int { |
1✔ |
6 |
return time.Now().Hour()
|
1✔ |
7 |
} |
1✔ |
8 |
|
|
9 |
func minute() int { |
1✔ |
10 |
return time.Now().Minute()
|
1✔ |
11 |
} |
1✔ |
12 |
|
|
13 |
func second() int { |
1✔ |
14 |
return time.Now().Second()
|
1✔ |
15 |
} |
1✔ |
16 |
|
|
17 |
func month() int { |
1✔ |
18 |
return int(time.Now().Month()) |
1✔ |
19 |
} |
1✔ |
20 |
|
|
21 |
func year() int { |
1✔ |
22 |
return time.Now().Year()
|
1✔ |
23 |
} |
1✔ |
24 |
|
|
25 |
func day() int { |
1✔ |
26 |
return time.Now().Day()
|
1✔ |
27 |
} |
1✔ |
28 |
|
|
29 |
func yearday() int { |
1✔ |
30 |
return time.Now().YearDay()
|
1✔ |
31 |
} |
1✔ |
32 |
|
|
33 |
func weekday() int { |
1✔ |
34 |
// 星期天返回0,手动改成7
|
1✔ |
35 |
t := time.Now().Weekday() |
1✔ |
36 |
if t == 0 { |
1✔ |
UNCOV
37
|
t = 7
|
× |
UNCOV
38
|
} |
× |
39 |
return int(t) |
1✔ |
40 |
} |