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

cmd/gofmt: incorrect removing spaces #5976

Closed
gopherbot opened this issue Jul 28, 2013 · 2 comments
Closed

cmd/gofmt: incorrect removing spaces #5976

gopherbot opened this issue Jul 28, 2013 · 2 comments

Comments

@gopherbot
Copy link

by soariez:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. http://play.golang.org/p/EfAZLsvwnr
2. press Format
3. the spaces between 'map[string]', 'int', and '{' disapper

What is the expected output?

package test

var foo = map[string] int {
    "test": 1,
}

What do you see instead?

package test

var foo = map[string]int{
    "test": 1,
}
@remyoudompheng
Copy link
Contributor

Comment 1:

Removing spaces is part of the formatting.

Status changed to WorkingAsIntended.

@gopherbot
Copy link
Author

Comment 2 by soariez:

I thought it should behave like:
http://golang.org/doc/effective_go.html#maps
However it looks like go's spec uses another format:
http://golang.org/ref/spec#Map_types
I am ok to follow spec's convention, although the above one looks better to me.
Thanks.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
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

2 participants