Fix infinite recursion when printing unrecognized linktype

Bug: N/A
Test: remove some cases from String() so that some linktypes go to the
default path. Then run m nothing. No infinite recursion. Error is
correctly shown.
PANIC=String method: unrecognized linktype: 5
Change-Id: I424755bc89871fc2144ff22d6391f57157cd434d

Change-Id: Ice791025dc50f44ffabd1050bafc5ea35023d32c
This commit is contained in:
Jiyong Park
2021-02-23 11:14:31 +09:00
parent 05785f0023
commit d4cbf34032

View File

@@ -1038,7 +1038,7 @@ func (lt linkType) String() string {
case javaPlatform:
return "private API"
default:
panic(fmt.Errorf("unrecognized linktype: %v", lt))
panic(fmt.Errorf("unrecognized linktype: %d", lt))
}
}