We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
译文中描述:map中所有的key都有相同的类型,所有的value也有着相同的类型,但是key和value之间可以是不同的数据类型, 这个在目前是错误的,map[string]interface{} 或者 map[interface{}]interface{} 这种就可以是的key的类型可以不同,value的类型也可以不同。
The text was updated successfully, but these errors were encountered:
这个有点混淆了抽象类型与具体类型。这里如果map的定义是接受A类型,那么任何匹配A类型的数据都可以使用。对这个map而言,所有传入的数据就是抽象类型A,不关心具体类型是A1或者A2。 map[string]interface{}这样的定义产生的疑惑在于interface{}是一个高度抽象的类型,谁都可以匹配它。但字面来说,map就是只接受interface{}这个类型的。
Sorry, something went wrong.
No branches or pull requests
译文中描述:map中所有的key都有相同的类型,所有的value也有着相同的类型,但是key和value之间可以是不同的数据类型,
这个在目前是错误的,map[string]interface{} 或者 map[interface{}]interface{} 这种就可以是的key的类型可以不同,value的类型也可以不同。
The text was updated successfully, but these errors were encountered: