I haven't tested this, but maybe it will serve you as a starting point.
Throw this script into $PATH (let's say into ~/.local/bin/diff-fmt):
#!/bin/bash
exec delta <(gofmt "$1") <(gofmt "$2")
here I'm using delta as the difftool: https://github.com/dandavison/deltaand then, once:
$ git config --global interactive.diffFilter diff-fmt