show the patch names

This commit is contained in:
Jeff Carr 2024-12-27 21:29:20 -06:00
parent 7a8f54a192
commit 20ea487d06
1 changed files with 16 additions and 2 deletions

View File

@ -56,8 +56,22 @@ func listPatchsets(w http.ResponseWriter) {
for _, entry := range entries {
// Check if the entry is a file and matches the *.pb pattern
if !entry.IsDir() && filepath.Ext(entry.Name()) == ".pb" {
fmt.Fprintln(w, entry.Name())
fmt.Println(entry.Name())
bytes, err := os.ReadFile(filepath.Join(dirname, entry.Name()))
if err != nil {
fmt.Fprintln(w, entry.Name(), err)
fmt.Println(entry.Name(), err)
continue
}
var p *forgepb.Patchs
p = new(forgepb.Patchs)
err = p.Unmarshal(bytes)
if err != nil {
fmt.Fprintln(w, entry.Name(), err)
fmt.Println(entry.Name(), err)
continue
}
fmt.Fprintln(w, entry.Name(), p.Name, p.Comment)
fmt.Println(entry.Name(), p.Name, p.Comment)
}
}
}