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

binary constants are not accepted #48

Open
halmai opened this issue Jun 28, 2024 · 1 comment
Open

binary constants are not accepted #48

halmai opened this issue Jun 28, 2024 · 1 comment

Comments

@halmai
Copy link

halmai commented Jun 28, 2024

Binary const declaration like const b = 0b100 does not work.

package main

import (
	"fmt"
)

func main() {
	const a = 100
	const b = 0b100

	fmt.Println(a + b)
}

This code reports an error message while it should run properly:

9:13: expected ';', found 'IDENT' b100 (and 2 more errors)
@halmai
Copy link
Author

halmai commented Jun 28, 2024

Here is the sample code in the editor: https://goplay.space/#S6RBEz3asW7

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

1 participant