mirror of
https://github.com/projectdiscovery/subfinder
synced 2026-06-21 14:05:24 +00:00
2a8ce2f3e6
* feat: add shodanct passive source * fix lint --------- Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
32 lines
622 B
Go
32 lines
622 B
Go
package runner
|
|
|
|
import (
|
|
fileutil "github.com/projectdiscovery/utils/file"
|
|
stringsutil "github.com/projectdiscovery/utils/strings"
|
|
)
|
|
|
|
func loadFromFile(file string) ([]string, error) {
|
|
var items []string
|
|
for item, err := range fileutil.Lines(file) {
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
item = preprocessDomain(item)
|
|
if item == "" {
|
|
continue
|
|
}
|
|
items = append(items, item)
|
|
}
|
|
return items, nil
|
|
}
|
|
|
|
func preprocessDomain(s string) string {
|
|
return stringsutil.NormalizeWithOptions(s,
|
|
stringsutil.NormalizeOptions{
|
|
StripComments: true,
|
|
TrimCutset: "\n\t\"'` ",
|
|
Lowercase: true,
|
|
},
|
|
)
|
|
}
|