mirror of
https://github.com/mxpv/podsync.git
synced 2024-05-11 05:55:04 +00:00
22 lines
289 B
Go
22 lines
289 B
Go
|
package ytdl
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
|
||
|
log "github.com/sirupsen/logrus"
|
||
|
)
|
||
|
|
||
|
type tempFile struct {
|
||
|
*os.File
|
||
|
dir string
|
||
|
}
|
||
|
|
||
|
func (f *tempFile) Close() error {
|
||
|
err := f.File.Close()
|
||
|
err1 := os.RemoveAll(f.dir)
|
||
|
if err1 != nil {
|
||
|
log.Errorf("could not remove temp dir: %v", err1)
|
||
|
}
|
||
|
return err
|
||
|
}
|