Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eq and ne tpl function issue #966

Closed
wants to merge 1 commit into from

Conversation

tatsushid
Copy link
Contributor

eq and ne template functions don't work as expected when those are
used with a raw number and a calculated value by add, sub etc. It's
caused by both numbers type differences. For example, eq 5 (add 2 3)
returns false because raw 5 is int while add 2 3 returns 5 with
int64

This normalizes int, uint and float type values to int64,
uint64 and float64 before comparing them. Other type of value is
passed to comparing function without any changes.

Fix #961

`eq` and `ne` template functions don't work as expected when those are
used with a raw number and a calculated value by add, sub etc. It's
caused by both numbers type differences. For example, `eq 5 (add 2 3)`
returns `false` because raw 5 is `int` while `add 2 3` returns 5 with
`int64`

This normalizes `int`, `uint` and `float` type values to `int64`,
`uint64` and `float64` before comparing them. Other type of value is
passed to comparing function without any changes.

Fix gohugoio#961
@bep
Copy link
Member

bep commented Mar 9, 2015

That was fast. Merged in 44cdb37

@bep bep closed this Mar 9, 2015
@spf13 spf13 reopened this Mar 9, 2015
@bep bep closed this Mar 9, 2015
@github-actions
Copy link

github-actions bot commented Mar 4, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eq has problems operating on range's index since 0.13
3 participants