if pmeth != nil {
meth = *pmeth
}
+
+ // For gccgo, strip out quoted strings.
+ s1 = unquote(s1)
+ s2 = unquote(s2)
+ s3 = unquote(s3)
+
*ret = &TypeAssertionError{s1, s2, s3, meth}
}
+// Remove quoted strings from gccgo reflection strings.
+func unquote(s string) string {
+ ls := len(s)
+ var i int
+ for i = 0; i < ls; i++ {
+ if s[i] == '\t' {
+ break
+ }
+ }
+ if i == ls {
+ return s
+ }
+ var q bool
+ r := make([]byte, len(s))
+ j := 0
+ for i = 0; i < ls; i++ {
+ if s[i] == '\t' {
+ q = !q
+ } else if !q {
+ r[j] = s[i]
+ j++
+ }
+ }
+ return string(r[:j])
+}
+
// An errorString represents a runtime error described by a single string.
type errorString string