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

text/template: integer hex number consisting "e" or "E" letter is parsed as float64 #8622

Closed
gopherbot opened this issue Aug 31, 2014 · 4 comments
Milestone

Comments

@gopherbot
Copy link

by antage:

What does 'go version' print?
go version go1.3.1 linux/amd64

What steps reproduce the problem?
1. Parse and execute template consisting integer hex number with "e" or
"E" letter (for example: 0xFE, 0xee, 0xBEA9).
2. Get type of the number.

What happened?
Any integer hex number with "e" or "E" letter has type float64.
Any integer hex number without "e" or "E" letter has type int.

What should have happened instead?
All integer hex number should have type int.

Please provide any additional information below.
This example demonstrates the issue: http://play.golang.org/p/O7jQmuWX6d
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-go1.4.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Sep 3, 2014

Comment 2:

Stupid bug from stupid code.

@gopherbot
Copy link
Author

Comment 3:

CL https://golang.org/cl/133530043 mentions this issue.

@robpike
Copy link
Contributor

robpike commented Sep 3, 2014

Comment 4:

This issue was closed by revision 55fa765.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
The discriminator in the execution engine was stupid.
Add a test to the parse package too. The problem wasn't there
but the particular case ('e' in a hex integer) was not covered.

Fixes golang#8622.

LGTM=ruiu
R=golang-codereviews, ruiu
CC=golang-codereviews
https://golang.org/cl/133530043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
The discriminator in the execution engine was stupid.
Add a test to the parse package too. The problem wasn't there
but the particular case ('e' in a hex integer) was not covered.

Fixes golang#8622.

LGTM=ruiu
R=golang-codereviews, ruiu
CC=golang-codereviews
https://golang.org/cl/133530043
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants