baseName returns the last path element of the name, with the last dotted suffix removed.
(name string)
| 2746 | |
| 2747 | // baseName returns the last path element of the name, with the last dotted suffix removed. |
| 2748 | func baseName(name string) string { |
| 2749 | // First, find the last element |
| 2750 | if i := strings.LastIndex(name, "/"); i >= 0 { |
| 2751 | name = name[i+1:] |
| 2752 | } |
| 2753 | // Now drop the suffix |
| 2754 | if i := strings.LastIndex(name, "."); i >= 0 { |
| 2755 | name = name[0:i] |
| 2756 | } |
| 2757 | return name |
| 2758 | } |
| 2759 | |
| 2760 | // The SourceCodeInfo message describes the location of elements of a parsed |
| 2761 | // .proto file by way of a "path", which is a sequence of integers that |
no outgoing calls
no test coverage detected