Select will select a bug for future use
(repo *cache.RepoCache, namespace string, id entity.Id)
| 92 | |
| 93 | // Select will select a bug for future use |
| 94 | func Select(repo *cache.RepoCache, namespace string, id entity.Id) error { |
| 95 | filename := selectFileName(namespace) |
| 96 | f, err := repo.LocalStorage().OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666) |
| 97 | if err != nil { |
| 98 | return err |
| 99 | } |
| 100 | |
| 101 | _, err = f.Write([]byte(id.String())) |
| 102 | if err != nil { |
| 103 | _ = f.Close() |
| 104 | return err |
| 105 | } |
| 106 | |
| 107 | return f.Close() |
| 108 | } |
| 109 | |
| 110 | // Clear will clear the selected entity, if any |
| 111 | func Clear(repo *cache.RepoCache, namespace string) error { |