Explorar el Código

gofmt: add page (#1730)

Nalin Bhardwaj hace 7 años
padre
commit
5054170ce7
Se han modificado 1 ficheros con 19 adiciones y 0 borrados
  1. 19 0
      pages/common/gofmt.md

+ 19 - 0
pages/common/gofmt.md

@@ -0,0 +1,19 @@
+# gofmt
+
+> Tool for formatting Go source code.
+
+- Format a file and display the result to the console:
+
+`gofmt {{source.go}}`
+
+- Format a file, overwriting the original file in-place:
+
+`gofmt -w {{source.go}}`
+
+- Format a file, and then simplify the code, overwriting the original file:
+
+`gofmt -s -w {{source.go}}`
+
+- Print all (including spurious) errors:
+
+`gofmt -e {{source.go}}`