Reflection / Primitive types / Essential Go
package main
import (
"fmt"
"reflect"
)
func getIntValue(v interface{}) {
var reflectValue = reflect.ValueOf(v)
n := reflectValue.Int()
fmt.Printf("Int value is: %d\n", n)
}
func main() {
getIntValue(3)
getIntValue(int8(4))
getIntValue("")
}INFO