Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package timeago |
||
2 | |||
3 | const ( |
||
4 | Upcoming Option = "upcoming" |
||
5 | Online Option = "online" |
||
6 | JustNow Option = "justNow" |
||
7 | NoSuffix Option = "noSuffix" |
||
8 | ) |
||
9 | |||
10 | type Option string |
||
11 | |||
12 | func enableOption(opt Option) { |
||
13 | options = append(options, opt) |
||
14 | } |
||
15 | |||
16 | func enableOptions(opts []Option) { |
||
17 | for _, opt := range opts { |
||
18 | enableOption(opt) |
||
19 | } |
||
20 | } |
||
21 | |||
22 | func optionIsEnabled(opt Option) bool { |
||
23 | for _, option := range options { |
||
24 | if option == opt { |
||
25 | return true |
||
26 | } |
||
27 | } |
||
28 | |||
29 | return false |
||
30 | } |
||
31 |