IsValidGoIdentity checks if the given string can be used as a name of variable, constant, or type.
(str string)
| 742 | // IsValidGoIdentity checks if the given string can be used as a |
| 743 | // name of variable, constant, or type. |
| 744 | func IsValidGoIdentity(str string) bool { |
| 745 | if IsGoIdentity(str) { |
| 746 | return false |
| 747 | } |
| 748 | |
| 749 | return !IsPredeclaredGoIdentifier(str) |
| 750 | } |
| 751 | |
| 752 | // SanitizeGoIdentifier replaces illegal runes in the given string so that |
| 753 | // it is a valid Go identifier. Unlike SanitizeGoIdentity, it does not |
no test coverage detected