func countByFinished(db repo.DB, finished bool) (int, error) { var n int err := db.QueryRow("select count(*) from todo where finished = ?", finished).Scan(&n) return n, err }