Passed
Push — v3.0.0 ( 671bfc...c3fef3 )
by Serhii
01:12
created

timeago.Config.LocationIsSet   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
c 0
b 0
f 0
rs 10
nop 0
1
package timeago
2
3
type Config struct {
4
	Language string
5
6
	// Location is the timezone location neeed for parsing
7
	// string date like "2019-01-01 00:00:00" to time.Time.
8
	// If Location is not set it will default to the server's.
9
	// Example: "America/New_York", "Asia/China"
10
	Location string
11
12
	Translations []Translation
13
}
14
15
func NewConfig(lang, loc string, trans []Translation) *Config {
16
	return &Config{
17
		Language:     lang,
18
		Location:     loc,
19
		Translations: trans,
20
	}
21
}
22
23
func (c Config) LocationIsSet() bool {
24
	return c.Location != ""
25
}
26