feat: prevent stdout close

This commit is contained in:
wpetit 2022-08-01 17:13:02 +02:00 committed by Bornholm
parent bbdfb30205
commit 1c770b7413

View File

@ -15,9 +15,21 @@ func (h *UpdaterHandler) Match(url *url.URL) bool {
}
func (u *UpdaterHandler) Update(url *url.URL) (io.WriteCloser, error) {
return os.Stdout, nil
return &stdoutFakeCloser{}, nil
}
func NewUpdaterHandler() *UpdaterHandler {
return &UpdaterHandler{}
}
type stdoutFakeCloser struct {
io.WriteCloser
}
func (c *stdoutFakeCloser) Write(p []byte) (n int, err error) {
return os.Stdout.Write(p)
}
func (c *stdoutFakeCloser) Close() error {
return nil
}