Golang reflect.Kind type example
package reflect
Golang reflect.Kind type usage example
package main
import (
"fmt"
"reflect"
)
func main() {
var anInteger int
var varType reflect.Type = reflect.TypeOf(anInteger)
fmt.Printf("anInteger is kind of %v and it is proven %v", varType.Kind(), varType.Kind() == reflect.Int)
}
Output :
anInteger is kind of int and it is proven true
Reference :
Advertisement
Something interesting
Tutorials
+8.2k Golang : Find relative luminance or color brightness
+7.5k Golang : Rename part of filename
+12.5k Golang : "https://" not allowed in import path
+5.7k Golang : ROT32768 (rotate by 0x80) UTF-8 strings example
+5.4k Golang : What is StructTag and how to get StructTag's value?
+30.6k Golang : Remove characters from string example
+15.3k Golang : Get query string value on a POST request
+12k Golang : Decompress zlib file example
+18.7k Unmarshal/Load CSV record into struct in Go
+4.5k Java : Generate multiplication table example
+19.5k Golang : How to Set or Add Header http.ResponseWriter?
+11.1k Golang : Read until certain character to break for loop