openFlowDBForWorkdir opens the flow DB and returns (db, rc). On error, it prints and returns a non-nil error rc.
()
| 39 | // openFlowDBForWorkdir opens the flow DB and returns (db, rc). On error, it |
| 40 | // prints and returns a non-nil error rc. |
| 41 | func openFlowDBForWorkdir() (*sql.DB, int) { |
| 42 | dbPath, err := flowDBPath() |
| 43 | if err != nil { |
| 44 | fmt.Fprintf(os.Stderr, "error: %v\n", err) |
| 45 | return nil, 1 |
| 46 | } |
| 47 | db, err := flowdb.OpenDB(dbPath) |
| 48 | if err != nil { |
| 49 | fmt.Fprintf(os.Stderr, "error: open db: %v\n", err) |
| 50 | return nil, 1 |
| 51 | } |
| 52 | return db, 0 |
| 53 | } |
| 54 | |
| 55 | // cmdWorkdirList prints all registered workdirs sorted by last_used_at |
| 56 | // descending (NULLs last). Each row is rendered across two output lines |
no test coverage detected