MCPcopy Create free account
hub / github.com/cloudflare/cfssl / parseCSV

Function parseCSV

cli/scan/scan.go:67–85  ·  view source on GitHub ↗
(hosts []string, csvFile string, maxHosts int)

Source from the content-addressed store, hash-verified

65}
66
67func parseCSV(hosts []string, csvFile string, maxHosts int) ([]string, error) {
68 f, err := os.Open(csvFile)
69 if err != nil {
70 return nil, err
71 }
72 defer f.Close()
73
74 r := csv.NewReader(f)
75 for err == nil && len(hosts) < maxHosts {
76 var record []string
77 record, err = r.Read()
78 hosts = append(hosts, record[len(record)-1])
79 }
80 if err == io.EOF {
81 err = nil
82 }
83
84 return hosts, err
85}
86
87func scanMain(args []string, c cli.Config) (err error) {
88 if c.List {

Callers 1

scanMainFunction · 0.85

Calls 3

OpenMethod · 0.45
CloseMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…