github.com/aquayi/gokit@v0.0.0-20170805152833-88827a405d9b/struct.go (about)

     1  package GoKit
     2  
     3  import "reflect"
     4  
     5  // IsSameType 判断两个interface{}类型的变量的原始类型是否相等
     6  func IsSameType(a, b interface{}) bool {
     7  	at := reflect.TypeOf(a).Kind()
     8  	bt := reflect.TypeOf(b).Kind()
     9  
    10  	if at == bt {
    11  		return true
    12  	}
    13  	return false
    14  }