(type interface {}) to type string

go 语言开发中,常常会在函数中碰到使用 insterface{} 做为接收任意参数,可是咱们接收的数据常常是须要作类型转换,因为是初学者,所以,初次转换我是直接就html func New(parameters map[string]interface{}) (*driver, error){ hostname, _ := string(parameters["HostName"])
相关文章
相关标签/搜索