package extract import ( "os" ) type Extractor struct { params *Params Clean bool } func NewExtractor(params *Params) *Extractor { os.MkdirAll(params.OutputPath, 0755) os.MkdirAll(params.TempPath, 0755) return &Extractor{params: params, Clean: true} } func (e *Extractor) Cleanup() error { if e.Clean { os.RemoveAll(e.params.TempPath) } return nil }