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

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 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 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 as completed May 30, 2020
@golang golang locked and limited conversation to collaborators May 30, 2021
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

4 participants