-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg: replace some string handling with go/types logic
The logic is a bit less repetitive and principled this way; for example, we don't need to detect lists and maps by string prefix, and we restrict the use of strings.Title on basic type names. Be more defensive in the adtKind method by failing if we reach the default switch case, so that we don't end up on adt.TopKind by accident. We also skip past pointers via go/types, as they don't affect any logic. Give the two methods slightly better names and some documentation too. While here, remove switch cases which are entirely unused and cannot be used because we don't have support for them in CallCtxt, such as *big.Rat and time.Time. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I0ff8df76358fd558f97d3ba711d19f4d69b1b843 Dispatch-Trailer: {"type":"trybot","CL":1201035,"patchset":2,"ref":"refs/changes/35/1201035/2","targetBranch":"master"}
- Loading branch information
Showing
1 changed file
with
71 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters