MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / loadDSN

Function loadDSN

cmd/cql/internal/cfg.go:212–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

210}
211
212func loadDSN() []string {
213 dsnFilePath := path.Join(conf.GConf.WorkingRoot, ".dsn")
214 dsns, err := ioutil.ReadFile(dsnFilePath)
215 if err != nil {
216 if !os.IsNotExist(err) {
217 ConsoleLog.WithError(err).Error("load dsn file failed")
218 }
219 return nil
220 }
221 return strings.Split(string(dsns), "\n")
222}
223
224func storeOneDSN(dsn string) {
225 dsnArray := loadDSN()

Callers 2

runConsoleFunction · 0.85
storeOneDSNFunction · 0.85

Calls 2

ErrorMethod · 0.80
WithErrorMethod · 0.80

Tested by

no test coverage detected