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

Calling _fullid from commandline is removing underscores #85

Closed
sboodman opened this issue Sep 10, 2019 · 3 comments
Closed

Calling _fullid from commandline is removing underscores #85

sboodman opened this issue Sep 10, 2019 · 3 comments

Comments

@sboodman
Copy link
Collaborator

The _fullid function in bundle.js removes underscores from number arguments.

Ex. exec _fullid 1_2 returns 12 instead of 1_2.

Only works when you use single quotes surrounding double quotes - Ex. exec _fullid '"1_2"'

@aboodman
Copy link
Owner

It's because of the argument handling in rep:

https://github.com/aboodman/replicant/blob/master/cmd/rep/main.go#L122

We rely on strconv.ParseFloat from the Go stdlib, and it allows underscores in number literals "for readability". I remember when I wrote this feeling like it would probably come back to bite me 🤷‍♂️🐊.

There is probably a better function somewhere that interprets float literals more strictly.

@aboodman
Copy link
Owner

(note to future-self ☝🏽)

@aboodman
Copy link
Owner

aboodman commented Nov 6, 2019

Moved to rocicorp/replicache-client#11

@aboodman aboodman closed this as completed Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants