MCPcopy Create free account
hub / github.com/antonmedv/gitmal / parseUnquotedName

Function parseUnquotedName

pkg/gitdiff/file_header.go:454–467  ·  view source on GitHub ↗
(s string, term byte)

Source from the content-addressed store, hash-verified

452}
453
454func parseUnquotedName(s string, term byte) (name string, n int, err error) {
455 for n = 0; n < len(s); n++ {
456 if s[n] == '\n' {
457 break
458 }
459 if term > 0 && s[n] == term {
460 break
461 }
462 }
463 if n == 0 {
464 return "", 0, fmt.Errorf("missing name")
465 }
466 return s[:n], n, nil
467}
468
469// verifyGitHeaderName checks a parsed name against state set by previous lines
470func verifyGitHeaderName(parsed, existing string, isNull bool, side string) error {

Callers 1

parseNameFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected