(path string)
| 15 | } |
| 16 | |
| 17 | func LoadIdent(path string) (err error, ident Identity) { |
| 18 | ident = Identity{Path: path} |
| 19 | file, err := os.Open(path) |
| 20 | if err != nil { |
| 21 | return |
| 22 | } |
| 23 | defer file.Close() |
| 24 | |
| 25 | raw, err := ioutil.ReadAll(file) |
| 26 | if err != nil { |
| 27 | return |
| 28 | } |
| 29 | |
| 30 | if err = json.Unmarshal(raw, &ident); err != nil { |
| 31 | return |
| 32 | } |
| 33 | |
| 34 | return |
| 35 | } |