New interface to Typer: the function TypeName() returns a more readable type name
This commit is contained in:
@@ -90,6 +90,14 @@ func (dict *DictType) ToString(opt FmtOpt) string {
|
||||
return sb.String()
|
||||
}
|
||||
|
||||
func (dict *DictType) String() string {
|
||||
return dict.ToString(0)
|
||||
}
|
||||
|
||||
func (dict *DictType) TypeName() string {
|
||||
return "dict"
|
||||
}
|
||||
|
||||
func (dict *DictType) hasKey(target any) (ok bool) {
|
||||
for key := range *dict {
|
||||
if ok = reflect.DeepEqual(key, target); ok {
|
||||
|
||||
Reference in New Issue
Block a user