reflect: fix Type.Name to return empty string for non-named types
// Name returns the type's name within its package for a defined type. // For other (non-defined) types it returns the empty string.
Этот коммит содержится в:
родитель
c6728643e6
коммит
9f02340a26
1 изменённых файлов: 5 добавлений и 1 удалений
|
@ -923,7 +923,11 @@ func (t *rawType) Name() string {
|
|||
return readStringZ(unsafe.Pointer(&ntype.name[0]))
|
||||
}
|
||||
|
||||
return t.Kind().String()
|
||||
if t.Kind() <= UnsafePointer {
|
||||
return t.Kind().String()
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func (t *rawType) Key() Type {
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче