Golang中有3种数据类型不能比较

Golang中有3种数据类型不能比较,分别是slice、map、func,如果要比较这3种类型,使用reflect.DeepEqual函数。

具体参考:Golang编程规范-比较操作符

链接:https://go.dev/ref/spec#Comparison_operators

posted @ 2024-01-25 15:12  技术颜良  阅读(60)  评论(0)    收藏  举报