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

go fmt: lack new line #39319

Closed
kzhui125 opened this issue May 30, 2020 · 2 comments
Closed

go fmt: lack new line #39319

kzhui125 opened this issue May 30, 2020 · 2 comments

Comments

@kzhui125
Copy link

@kzhui125 kzhui125 commented May 30, 2020

hello, when running go fmt on this file, I expect there is a new line above func main() {

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

package main

import (
	"fmt"
)

func test() {
	fmt.Println()
}
func main() {
	fmt.Println("Hello, playground")
}
@yonlugoh
Copy link

@yonlugoh yonlugoh commented May 30, 2020

The test() function was never called
This works

package main

import (
	"fmt"
)

func test() {
	fmt.Println()
}
func main() {
	test()
	fmt.Println("Hello, playground")
}
@ALTree
Copy link
Member

@ALTree ALTree commented May 30, 2020

Hi, this is a dup of #22337. See in particular #22337 (comment) for an answer. Closing here.

@ALTree ALTree closed this May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.