MCPcopy Create free account
hub / github.com/Moopinger/smugglefuzz / ReadPayloadsFile

Function ReadPayloadsFile

lib/payload.go:21–31  ·  view source on GitHub ↗
(fileName string)

Source from the content-addressed store, hash-verified

19}
20
21func ReadPayloadsFile(fileName string) ([]string, error) {
22 content, err := os.ReadFile(fileName)
23 if err != nil {
24 return nil, err
25 }
26
27 unifiedContent := strings.ReplaceAll(string(content), "\r\n", "\n")
28 lines := strings.Split(unifiedContent, "\n")
29
30 return lines, nil
31}
32
33func WritePayloadsToFile(payloads []Payload, hostname string, fileName string) error {
34 file, err := os.OpenFile(fileName, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)

Callers 1

scan.goFile · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected