mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 05:24:22 +01:00
main.go, need to work on tests next
This commit is contained in:
1 parent
2b995fda44
commit
1c14586cde
1 file changed
+3
-3
@@ -67,6 +67,7 @@ const leakExit = 1
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
opts *Options
|
opts *Options
|
||||||
|
config *Config
|
||||||
singleSearchRegex *regexp.Regexp
|
singleSearchRegex *regexp.Regexp
|
||||||
dir string
|
dir string
|
||||||
threads int
|
threads int
|
||||||
@@ -74,7 +75,6 @@ var (
|
|||||||
commitMap = make(map[string]bool)
|
commitMap = make(map[string]bool)
|
||||||
cMutex = &sync.Mutex{}
|
cMutex = &sync.Mutex{}
|
||||||
auditDone bool
|
auditDone bool
|
||||||
config *Config
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -132,7 +132,6 @@ func run() ([]Leak, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Println(opts)
|
|
||||||
|
|
||||||
// start audits
|
// start audits
|
||||||
if opts.Repo != "" || opts.RepoPath != "" {
|
if opts.Repo != "" || opts.RepoPath != "" {
|
||||||
@@ -176,11 +175,12 @@ func run() ([]Leak, error) {
|
|||||||
// writeReport writes a report to a file specified in the --report= option.
|
// writeReport writes a report to a file specified in the --report= option.
|
||||||
// Default format for report is JSON. You can use the --csv option to write the report as a csv
|
// Default format for report is JSON. You can use the --csv option to write the report as a csv
|
||||||
func writeReport(leaks []Leak) error {
|
func writeReport(leaks []Leak) error {
|
||||||
|
var err error
|
||||||
|
|
||||||
if len(leaks) == 0 {
|
if len(leaks) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
|
||||||
log.Infof("writing report to %s", opts.Report)
|
log.Infof("writing report to %s", opts.Report)
|
||||||
if strings.HasSuffix(opts.Report, ".csv") {
|
if strings.HasSuffix(opts.Report, ".csv") {
|
||||||
f, err := os.Create(opts.Report)
|
f, err := os.Create(opts.Report)
|
||||||
|
|||||||
Reference in new issue
Block a user