diff --git a/regen.sh b/regen.sh
index d4612dacb14f8d2055fa50545bb264815ed49811..55242b770bfef5835158dffa5caf7e6fc3d6ab1c 100755
--- a/regen.sh
+++ b/regen.sh
@@ -73,4 +73,6 @@ go run regen.go -go_out "$root/src" -pkg_prefix "$PKG" "$apidir" "$protodir"
 echo 1>&2 "Checking that the libraries build..."
 go build -v ./...
 
+gofmt -s -l -w . && goimports -w .
+
 echo 1>&2 "All done!"