Replace skipPast with strings.TrimPrefix.

There was a bug in skipPast; it was skipping to the start of the string,
rather than the end of it. But more of an issue is that it would skip if
it was in the middle of the string, which caused problems when
STACK_OF(FOO) was used as a parameter.

At some point, we'll probably need to give this a real C declaration
parser. We still have declarations (like those that return function
pointers) which we can't parse. But for now let's clear the low-hanging
fruit.

Change-Id: Ic2cee452cc8cf6887a6ff1b00cea353cec361955
Reviewed-on: https://boringssl-review.googlesource.com/5875
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/util/doc.go b/util/doc.go
index 9d6d576..23cd5f4 100644
--- a/util/doc.go
+++ b/util/doc.go
@@ -189,14 +189,6 @@
 	return
 }
 
-func skipPast(s, skip string) string {
-	i := strings.Index(s, skip)
-	if i > 0 {
-		return s[i:]
-	}
-	return s
-}
-
 func skipLine(s string) string {
 	i := strings.Index(s, "\n")
 	if i > 0 {
@@ -224,8 +216,9 @@
 		}
 		return decl[:i], true
 	}
-	decl = skipPast(decl, "STACK_OF(")
-	decl = skipPast(decl, "LHASH_OF(")
+	decl = strings.TrimPrefix(decl, "OPENSSL_EXPORT ")
+	decl = strings.TrimPrefix(decl, "STACK_OF(")
+	decl = strings.TrimPrefix(decl, "LHASH_OF(")
 	i := strings.Index(decl, "(")
 	if i < 0 {
 		return "", false