mirror of
https://github.com/Bornholm/formidable.git
synced 2024-12-22 14:59:34 +01:00
feat: prevent stdout close
This commit is contained in:
parent
bbdfb30205
commit
1c770b7413
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user