show the patch names
This commit is contained in:
parent
7a8f54a192
commit
20ea487d06
18
patchsets.go
18
patchsets.go
|
@ -56,8 +56,22 @@ func listPatchsets(w http.ResponseWriter) {
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
// Check if the entry is a file and matches the *.pb pattern
|
// Check if the entry is a file and matches the *.pb pattern
|
||||||
if !entry.IsDir() && filepath.Ext(entry.Name()) == ".pb" {
|
if !entry.IsDir() && filepath.Ext(entry.Name()) == ".pb" {
|
||||||
fmt.Fprintln(w, entry.Name())
|
bytes, err := os.ReadFile(filepath.Join(dirname, entry.Name()))
|
||||||
fmt.Println(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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue