Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reflect: fix String of new array types
When constructing a new type for an array type in ArrayOf, we don't reset tflag to 0. All the other methods in the package, such as SliceOf, do this already. This results in the new array type having weird issues when being printed, such as having tflagExtraStar set when it shouldn't. That flag removes the first char to get rid of '*', but when used incorrectly in this case it eats the '[' character leading to broken strings like "3]int". This was fixed in 56752eb for issue golang#16722, but ArrayOf was missed. Also make the XM test struct have a non-zero size as that leads to a division by zero panic in ArrayOf. Fixes golang#20311. Change-Id: I18f1027fdbe9f71767201e7424269c3ceeb23eb5 Reviewed-on: https://go-review.googlesource.com/43130 Run-TryBot: Daniel Martí <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: David Crawshaw <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
- Loading branch information