Completed
Push — main ( d06217...431530 )
by Serhii
17s queued 15s
created

utils.UnixFromPastDate   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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