Skip to content

x/tools/gopls: strange unified diff #60379

@adonovan

Description

@adonovan

The unified diff output gopls format includes a \ No newline at end of file line in the middle of the file. Is that valid?

xtools$ git log | head -n 1
commit 7a03febeeead7497d3821eb99461ecfeae51c0ba

xtools$ cat a/a.go 
package a

type S struct {
s fmt.Stringer
}
xtools$ go run ./gopls format -d ./a/a.go
--- /Users/adonovan/w/xtools/a/a.go.orig
+++ /Users/adonovan/w/xtools/a/a.go
@@ -1,5 +1,6 @@
 package a
 
 type S struct {
+	
\ No newline at end of file
 s fmt.Stringer
 }

xtools$ go run ./gopls format -w ./a/a.go

xtools$ cat ./a/a.go 
package a

type S struct {
	s fmt.Stringer
}

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions