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

extend empty slice #36

Open
sentriz opened this issue Apr 22, 2020 · 1 comment
Open

extend empty slice #36

sentriz opened this issue Apr 22, 2020 · 1 comment

Comments

@sentriz
Copy link

sentriz commented Apr 22, 2020

I see the empty slice section
https://github.com/quasilyte/go-consistent#empty-map

does it make sense to include a var initialisation too? eg

	a := make([]int, 0)
	b := []int{}
	var c []int

https://play.golang.org/p/oI0oilKpgg7

@quasilyte
Copy link
Owner

Hello!
Sorry for the delayed response.

The var c []int initializes nil slice, so c == nil is true, while b == nil is false.
go-consistent tries to find 100% identical forms, so the code semantics do not change.

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