Passed
Push — v3.0.0 ( 268334 )
by Serhii
01:47
created

config.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
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
package config
2
3
type Config struct {
4
	Language     string
5
	Location     string
6
	Translations []Translation
7
}
8
9
func New(lang, loc string, trans []Translation) Config {
10
	return Config{
11
		Language:     lang,
12
		Location:     loc,
13
		Translations: trans,
14
	}
15
}
16
17
func (c Config) LocationIsSet() bool {
18
	return c.Location != ""
19
}
20
21
func (c Config) TranslationsAreSet() bool {
22
	return len(c.Translations) > 0
23
}
24