MCPcopy Index your code
hub / github.com/git-bug/git-bug / Select

Function Select

commands/select/select.go:94–108  ·  view source on GitHub ↗

Select will select a bug for future use

(repo *cache.RepoCache, namespace string, id entity.Id)

Source from the content-addressed store, hash-verified

92
93// Select will select a bug for future use
94func 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
111func Clear(repo *cache.RepoCache, namespace string) error {

Callers 1

TestSelectFunction · 0.85

Calls 5

selectFileNameFunction · 0.85
LocalStorageMethod · 0.65
StringMethod · 0.65
CloseMethod · 0.65
WriteMethod · 0.45

Tested by 1

TestSelectFunction · 0.68