Passed
Push — v3.0.0 ( 368635...9e91a1 )
by Serhii
01:21
created

langset.New   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 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
package langset
2
3
import "github.com/SerhiiCho/timeago/v3/ctx"
4
5
type LangForms map[string]string
6
7
type LangSet struct {
8
	Ago     string    `json:"ago"`
9
	Online  string    `json:"online"`
10
	JustNow string    `json:"justnow"`
11
	Second  LangForms `json:"second"`
12
	Minute  LangForms `json:"minute"`
13
	Hour    LangForms `json:"hour"`
14
	Day     LangForms `json:"day"`
15
	Week    LangForms `json:"week"`
16
	Month   LangForms `json:"month"`
17
	Year    LangForms `json:"year"`
18
}
19
20
func New(c *ctx.Ctx) *LangSet {
21
	return parseJsonIntoTrans("../langs/" + c.Config().Language + ".json")
22
}
23