Passed
Push — master ( b486cf...8123a4 )
by Serhii
02:01 queued 28s
created

config.go   A

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
cc 3
eloc 13
dl 0
loc 22
ccs 5
cts 5
cp 1
crap 3
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A timeago.SetConfig 0 10 3
1
package timeago
2
3
type Config struct {
4
	Language string
5
	Location string
6
}
7
8
var config = Config{
9
	Language: "en",
10
	Location: "America/New_York",
11
}
12
13
func SetConfig(conf Config) {
14 1
	if conf.Language == "" {
15 1
		conf.Language = config.Language
16
	}
17
18 1
	if conf.Location == "" {
19 1
		conf.Location = config.Location
20
	}
21
22 1
	config = conf
23
}
24