Emacs go-mode gofmt diff problem

By Xah Lee. Date: . Last updated: .

Shit. In emacs golang go-mode.el, the Alt+x gofmt command doesn't work on Microsoft Windows because it's trying to call unix shell command diff. Sloppy, plus, it shouldn't need to.

emacs go mode diff error 2021-01-15 hMChb
emacs go mode diff error 2021-01-15

gofmt command itself supports diff, by gofmt -d

gofmt diff 2021-01-15 tTvvp
gofmt diff 2021-01-15

now write my own. emacs lisp command to call gofmt. golang