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

config/config.go   A

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 14
dl 0
loc 22
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A config.Config.TranslationsAreSet 0 2 1
A config.Config.LocationIsSet 0 2 1
A config.New 0 5 1
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