Add support for automatic fixups to gofmt.

gofmt -w writes the gofmt result to the source file for the files that
gofmt reports issues.

Bug: 116112526
Test: ran hook for gofmt can now auto-fix formatting
Change-Id: Ic676a588a567fbe5cf3f7a1411ac8048bde2af06
diff --git a/rh/ b/rh/
index 491da91..dd4cab3 100644
--- a/rh/
+++ b/rh/
@@ -771,9 +771,10 @@
         data = rh.git.get_file_content(commit, d.file)
         result = _run(cmd, input=data)
         if result.stdout:
+            fixup_func = _fixup_func_caller([gofmt, '-w', d.file])
                 'gofmt', project, commit, error=result.stdout,
-                files=(d.file,)))
+                files=(d.file,), fixup_func=fixup_func))
     return ret