internal/utils/utils.go   A
last analyzed

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
dl 0
loc 13
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A utils.Errorf 0 2 1
A utils.UnixFromPastDate 0 2 1
1
package utils
2
3
import (
4
	"fmt"
5
	"time"
6
)
7
8
func UnixFromPastDate(subDuration time.Duration) int {
9
	return int(SubTime(subDuration).UnixNano() / 1000000000)
10
}
11
12
func Errorf(msg string, a ...interface{}) error {
13
	return fmt.Errorf("[Timeago]: "+msg, a...)
14
}
15