MCPcopy Create free account
hub / github.com/evilsocket/shellz / LoadIdent

Function LoadIdent

models/identity.go:17–35  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

15}
16
17func 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}

Callers 1

LoadFunction · 0.85

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected