MCPcopy
hub / github.com/hwholiday/learning_tools / getDbInfoByPath

Function getDbInfoByPath

gin/model/db.go:34–40  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

32 db.ShowSQL(true)
33}
34func getDbInfoByPath(path string) (db dbInfo) {
35 data, err := ioutil.ReadFile(path)
36 checkErr(err)
37 err = json.Unmarshal(data, &db)
38 checkErr(err)
39 return
40}
41
42func checkErr(err error) {
43 if err != nil {

Callers 1

InitDbFunction · 0.85

Calls 2

UnmarshalMethod · 0.80
checkErrFunction · 0.70

Tested by

no test coverage detected