The generated xgo_autogen.go file requires gofmt to reformat it. Ideally, the output should already be properly formatted so that gofmt produces no changes.
This was expected to be fixed by goplus/gogen#553 (included in gogen v1.20.6, which xgo v1.6.1 depends on), but it appears the issue persists.