(line, commentDelim string)
| 181 | } |
| 182 | |
| 183 | func 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 |
no outgoing calls
no test coverage detected