You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output of cgo is not canonical according to gofmt, as it has an excessive number of
tabs preceding many source lines, notably the import paths (e.g. "fmt") inside
the import block, as the example below shows. I suspect this is related to
printer.SourcePos mode and //line directives.
For what it's worth, I believe this behaviour is at least somewhat nondeterministic (it
caused my mapreduce consistency checks to fail), although I haven't succeeded in
reproducing that locally.
Deleting the blank line between the two imports hides the bug.
% go version
go version devel +6d6fbf7dee5b Mon Oct 20 11:10:03 2014 -0700 linux/amd64
% cat blurgh.go
package blurgh
import (
"blah"
"foo"
)
import "C"
var _ foo.Foo
var _ blah.Blah
% go tool cgo blurgh.go
% cat -t _obj/blurgh.cgo1.go
// Created by cgo - DO NOT EDIT
//line /home/adonovan/test/blurgh.go:1
package blurgh
//line /home/adonovan/test/blurgh.go:4
//line /home/adonovan/test/blurgh.go:3
import (
^I^I^I^I^I"blah"
//line /home/adonovan/test/blurgh.go:7
//line /home/adonovan/test/blurgh.go:6
^I"foo"
)
//line /home/adonovan/test/blurgh.go:12
//line /home/adonovan/test/blurgh.go:11
var _ foo.Foo
var _ blah.Blah
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: