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

Numbers with underscore in formatters.go causing build to fail (WSL Ubuntu) #220

Closed
mmmkkaaayy opened this issue Jan 6, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@mmmkkaaayy
Copy link

Hi, I'm not very proficient with Go, so feel free to close this if it sounds like a problem that only applies to my setup.

I tried to install scc using the instructions in the README. I'm using WSL1 with Ubuntu 18.04 on Windows 10.

go get -u github.com/boyter/scc/

# github.com/boyter/scc/processor
go/src/github.com/boyter/scc/processor/formatters.go:929:32: syntax error: unexpected _048_576 at end of statement
go/src/github.com/boyter/scc/processor/formatters.go:931:32: syntax error: unexpected _024_000 at end of statement
go/src/github.com/boyter/scc/processor/formatters.go:936:33: syntax error: unexpected _000_000 at end of statement
go/src/github.com/boyter/scc/processor/formatters.go:960:32: syntax error: unexpected _000_000 at end of statement

If I go into formatters.go and delete the underscores on the offending lines, the go get succeeds and I can use tool in ~/go/bin

Here's some info about my setup:
go version (installed with sudo apt install golang-go)

go version go1.10.4 linux/amd64

cat /etc/os-release

NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
@boyter
Copy link
Owner

boyter commented Jan 6, 2021

This is totally my fault. The minimum Go version needed now is actually 1.13, but the documentation said 1.10. Have fixed it in 7d515ba

Its due to number literals with underscores being added in 1.13, and I tend to use anything new if I can to ensure the compiled version has a good level of baseline performance you get on the new compiler.

Sorry about that. You will just need to get a version of Go >= 1.13 (I would suggest going with the latest though for the performance gains) and it should work.

@boyter
Copy link
Owner

boyter commented Jan 6, 2021

Closing down as it should be considered all find now.

@boyter boyter closed this as completed Jan 6, 2021
@boyter boyter added the bug Something isn't working label Jan 6, 2021
lukas-brenning added a commit to lukas-brenning/scc that referenced this issue Jan 13, 2021
* Update README.md

* SLOCCount came before cloc

* resolve boyter#206

* First cut at boyter#210

* Add "gohtml" and "gotxt" to the list of extensions for Go templates

These are the default extensions that e.g. GoLand uses, and some other
tools as well I believe. It's useful as it disambiguates between
templates for html/template and text/template.

* partial fix for boyter#214

* resolve after feedback

* Mostly ready for boyter#211

* real fix for issue214

* few tests and typo

* Resolvehttps://github.com/boyter/issues/208

* Update to remove wrong Go version mentioned boyter#220

Co-authored-by: Ben Boyter <[email protected]>
Co-authored-by: AlDanial <[email protected]>
Co-authored-by: Ben Boyter <[email protected]>
Co-authored-by: Martin Tournoij <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants