MCPcopy Create free account
hub / github.com/containerd/release-tool / sanitizeLine

Function sanitizeLine

util.go:183–198  ·  view source on GitHub ↗
(line, commentDelim string)

Source from the content-addressed store, hash-verified

181}
182
183func sanitizeLine(line, commentDelim string) string {
184 ln := strings.TrimSpace(line)
185 if ln == "" {
186 return ""
187 }
188 cidx := strings.Index(ln, commentDelim)
189 // whole line is commented
190 if cidx == 0 {
191 return ""
192 }
193 if cidx > 0 {
194 ln = ln[:cidx]
195 }
196
197 return strings.TrimSpace(ln)
198}
199
200// getCommitOrVersion parses the commit or version from go modules
201// and returns the commit sha or ref and whether the result is a git sha

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected