util.go
func getFieldWithTag(obj interface{}, tagName string) *reflect.Value {
	objVal := reflect.ValueOf(obj)
	if objVal.Kind() != reflect.Struct {
		objVal = objVal.Elem()
	}

	for i := 0; i < objVal.NumField(); i++ {
		fieldType := objVal.Type().Field(i)
		if tagName == fieldType.Tag.Get("jwt") {
			field := objVal.Field(i)
			return &field
		}
	}

	return nil
}
func getFieldWithTag(obj interface{}, tagName string) *reflect.Value {
	objVal := reflect.ValueOf(obj)
	if objVal.Kind() != reflect.Struct {
		objVal = objVal.Elem()
	}

	for i := 0; i < objVal.NumField(); i++ {
		fieldType := objVal.Type().Field(i)
		if tagName == fieldType.Tag.Get("jwt") {
			field := objVal.Field(i)
			return &field
		}
	}

	return nil
}
func getFieldWithTag ( obj interface { } , tagName string ) * reflect . Value { objVal := reflect . ValueOf ( obj ) if objVal . Kind ( ) != reflect . Struct { objVal = objVal . Elem ( ) } for i := 0 ; i < objVal . NumField ( ) ; i ++ { fieldType := objVal . Type ( ) . Field ( i ) if tagName == fieldType . Tag . Get ( " " ) { field := objVal . Field ( i ) return & field } } return nil }
// getFieldWithTag lookups jwt tag, with specified tagName on obj, returning
// its reflected value.
getFieldWithTag lookups jwt tag with specified tagName on obj returning its reflected value .