(type interface {}) to type string

go 語言開發中,常常會在函數中碰到使用 insterface{} 做爲接收任意參數,可是咱們接收的數據常常是須要作類型轉換,因爲是初學者,所以,初次轉換我是直接就html func New(parameters map[string]interface{}) (*driver, error){ hostname, _ := string(parameters["HostName"])
相關文章
相關標籤/搜索