MCPcopy Create free account
hub / github.com/Ringmast4r/PathFinder / LoadWordlist

Function LoadWordlist

main.go:3429–3451  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

3427}
3428
3429func LoadWordlist(path string) ([]string, error) {
3430 file, err := os.Open(path)
3431 if err != nil {
3432 return nil, err
3433 }
3434 defer file.Close()
3435
3436 var paths []string
3437 data, err := io.ReadAll(file)
3438 if err != nil {
3439 return nil, err
3440 }
3441
3442 lines := strings.Split(string(data), "\n")
3443 for _, line := range lines {
3444 line = strings.TrimSpace(line)
3445 if line != "" && !strings.HasPrefix(line, "#") {
3446 paths = append(paths, line)
3447 }
3448 }
3449
3450 return paths, nil
3451}
3452
3453func ExportToJSON(filename string, results []*ScanResult) error {
3454 file, err := os.Create(filename)

Callers 1

submitInputMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected