MCPcopy Create free account
hub / github.com/XmirrorSecurity/OpenSCA-cli / ReadLine

Function ReadLine

opensca/model/file.go:100–110  ·  view source on GitHub ↗

ReadLine 按行读取内容 去除行尾换行符

(reader io.Reader, do func(line string))

Source from the content-addressed store, hash-verified

98
99// ReadLine 按行读取内容 去除行尾换行符
100func ReadLine(reader io.Reader, do func(line string)) {
101
102 if do == nil {
103 return
104 }
105
106 scanner := bufio.NewScanner(reader)
107 for scanner.Scan() {
108 do(strings.TrimRight(scanner.Text(), "\n\r"))
109 }
110}
111
112// ReadLineNoComment 按行读取内容 忽略注释
113func ReadLineNoComment(reader io.Reader, t *CommentType, do func(line string)) {

Callers 2

ReadLineMethod · 0.85
ReadLineNoCommentFunction · 0.85

Calls 1

ScanMethod · 0.80

Tested by

no test coverage detected