1
0
mirror of https://github.com/securego/gosec.git synced 2025-07-05 00:29:02 +02:00

ondisk -> onDisk

This commit is contained in:
Lukas Aron
2020-05-18 17:35:14 +10:00
committed by Cosmin Cojocar
parent b2cfc5d638
commit 1418b856ea

View File

@ -23,7 +23,7 @@ type buildObj struct {
type TestPackage struct { type TestPackage struct {
Path string Path string
Files map[string]string Files map[string]string
ondisk bool onDisk bool
build *buildObj build *buildObj
} }
@ -38,7 +38,7 @@ func NewTestPackage() *TestPackage {
return &TestPackage{ return &TestPackage{
Path: workingDir, Path: workingDir,
Files: make(map[string]string), Files: make(map[string]string),
ondisk: false, onDisk: false,
build: nil, build: nil,
} }
} }
@ -49,7 +49,7 @@ func (p *TestPackage) AddFile(filename, content string) {
} }
func (p *TestPackage) write() error { func (p *TestPackage) write() error {
if p.ondisk { if p.onDisk {
return nil return nil
} }
for filename, content := range p.Files { for filename, content := range p.Files {
@ -57,7 +57,7 @@ func (p *TestPackage) write() error {
return e return e
} // #nosec G306 } // #nosec G306
} }
p.ondisk = true p.onDisk = true
return nil return nil
} }
@ -127,7 +127,7 @@ func (p *TestPackage) CreateContext(filename string) *gosec.Context {
// Close will delete the package and all files in that directory // Close will delete the package and all files in that directory
func (p *TestPackage) Close() { func (p *TestPackage) Close() {
if p.ondisk { if p.onDisk {
err := os.RemoveAll(p.Path) err := os.RemoveAll(p.Path)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)