heya,

i had some test struct with all kinds of different types and had it compare
them among each other wildly i think it didn't work the way you propose.
i'm in the middle of something right now and can't look at the code.

I will look at it properly in the next hour.

On an unrelated note, i would want to put a Powered by Revel Badge in the
footer of my project if you have nothing against that idea.
What's your take on this?

Greetings

Shaban


2013/3/17 Rob Figueiredo <notifications@github.com>

> In template.go:
>
> > @@ -40,7 +40,54 @@ var (
> >  	// The functions available for use in the templates.
> >  	TemplateFuncs = map[string]interface{}{
> >  		"url": ReverseUrl,
> > -		"eq":  func(a, b interface{}) bool { return a == b },
> > +		"eq": func(a, b interface{}) bool {
> > +			// both types are same don't cast anything
> > +			if reflect.TypeOf(a) == reflect.TypeOf(b) {
> > +				return a == b
> > +			}
> > +			// switch first parameter for int, uint, float and string types
> > +			// and look for equivalent types in other parameter
> > +			// if not equivalent no need to compare - return false
> > +			switch a.(type) {
> > +			case int, int8, int16, int32, int64:
> > +				switch b.(type) {
> > +				case int, int8, int16, int32, int64:
> > +					return reflect.ValueOf(a).Int() == reflect.ValueOf(b).Int()
>
> Actually -- I'm not sure if my suggestion works, since it will probably
> complain you can't cast type interface{} to int64. Never mind!
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/robfig/revel/pull/106/files#r3406024>
> .
>