mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Return errors for failed host clients
This commit is contained in:
1 parent
c5e1e8abc0
commit
f89b8f2b29
3 files changed
+11
-8
No files matched your search
+4
-3
@@ -20,11 +20,12 @@ type Host interface {
|
||||
// Run kicks off a host audit. This function accepts a manager and determines what host it should audit
|
||||
func Run(m *manager.Manager) error {
|
||||
var host Host
|
||||
var err error
|
||||
switch getHost(m.Opts.Host) {
|
||||
case _github:
|
||||
host = NewGithubClient(*m)
|
||||
host, err = NewGithubClient(*m)
|
||||
case _gitlab:
|
||||
host = NewGitlabClient(*m)
|
||||
host, err = NewGitlabClient(*m)
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
@@ -34,7 +35,7 @@ func Run(m *manager.Manager) error {
|
||||
} else {
|
||||
host.Audit()
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func getHost(host string) int {
|
||||
|
||||
Reference in new issue
Block a user