| Conditions | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package timeago |
||
| 26 | func newLangSet() (*LangSet, error) { |
||
| 27 | _, filename, _, ok := runtime.Caller(0) |
||
| 28 | |||
| 29 | if !ok { |
||
| 30 | return nil, createError("No called information") |
||
| 31 | } |
||
| 32 | |||
| 33 | rootPath := path.Dir(filename) |
||
| 34 | filePath := fmt.Sprintf(rootPath+"/langs/%s.json", conf.Language) |
||
| 35 | |||
| 36 | if cache, ok := cachedJsonRes[filePath]; ok { |
||
| 37 | return cache, nil |
||
| 38 | } |
||
| 39 | |||
| 40 | cachedJsonRes[filePath] = parseLangSet(filePath) |
||
| 41 | |||
| 42 | return cachedJsonRes[filePath], nil |
||
| 43 | } |
||
| 44 |