Add line number to doc.go error messages.

Change-Id: I00f35648a6d354abdc908314fef48b3fa573d825
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/42224
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/util/doc.go b/util/doc.go
index 33bcc66..bdcfcb0 100644
--- a/util/doc.go
+++ b/util/doc.go
@@ -410,7 +410,7 @@
 				break
 			}
 			if line == cppGuard {
-				return nil, errors.New("hit ending C++ guard while in section")
+				return nil, fmt.Errorf("hit ending C++ guard while in section on line %d", lineNo)
 			}
 
 			var comment []string
@@ -422,7 +422,7 @@
 				}
 			}
 			if len(lines) == 0 {
-				return nil, errors.New("expected decl at EOF")
+				return nil, fmt.Errorf("expected decl at EOF on line %d", lineNo)
 			}
 			declLineNo := lineNo
 			decl, lines, lineNo, err = extractDecl(lines, lineNo)