mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
3ac8494d23
git-subtree-dir: orbit git-subtree-mainline:d5974aad97
git-subtree-split:ab3047bb39
17 lines
385 B
Go
17 lines
385 B
Go
package update
|
|
|
|
import "os"
|
|
|
|
// fileDestination wraps the standard os.File with a Delete method for
|
|
// compatibility with the go-tuf Destination interface.
|
|
// Adapted from
|
|
// https://github.com/theupdateframework/go-tuf/blob/master/cmd/tuf-client/get.go
|
|
type fileDestination struct {
|
|
*os.File
|
|
}
|
|
|
|
func (f *fileDestination) Delete() error {
|
|
_ = f.Close()
|
|
return os.Remove(f.Name())
|
|
}
|