mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-19 11:31:03 +00:00
* fix: make patch list registry-only * feat: add patch command progress logs * fix: address review feedback for PR #921
23 lines
460 B
Go
23 lines
460 B
Go
package engine
|
|
|
|
import "fmt"
|
|
|
|
// Progress receives concise updates for operations that can take noticeable time.
|
|
type Progress interface {
|
|
Step(message string)
|
|
}
|
|
|
|
type ProgressFunc func(message string)
|
|
|
|
// Step sends one progress message through f.
|
|
func (f ProgressFunc) Step(message string) {
|
|
f(message)
|
|
}
|
|
|
|
func reportProgress(progress Progress, format string, args ...any) {
|
|
if progress == nil {
|
|
return
|
|
}
|
|
progress.Step(fmt.Sprintf(format, args...))
|
|
}
|