interface to int golang
iAreaId := val.(int)
iAreaId, ok := val.(int) // Alt. non panicking version
interface to int golang
iAreaId := val.(int)
iAreaId, ok := val.(int) // Alt. non panicking version
golang interface to int
var myInt interface{}
myInt = 8
toInt, ok := myInt.(int)
fmt.Println(toInt, ok) // 8 true
toString, ok := myInt.(string)
fmt.Println(toString, ok) // "" false
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us