decomp: Files | Directories

Command go-post

The go-post tool post-processes Go source code to make it more idiomatic (*.go -> *.go).

The input of go-post is unpolished Go source code and the output is more idiomatic Go source code.

usage: go tool fix [-diff] [-r fixname,...] [-force fixname,...] [path ...]
    	display diffs instead of rewriting files
  -force string
    	force these fixes to run even if the code looks updated
  -r string
    	restrict the rewrites to this comma-separated list

Available rewrites are:

	Replace "x = x + z" with "x += z".

	Remove "x = x" assignments.

	Remove unused labels.

	Add initialization and post-statements to for-loops.

	Replace return statements with calls to os.Exit in the "main" function.

	Replace assignment statements with declare and initialize statements at the first occurrence of an unresolved identifier.

Package Files

assignbinop.go cmain.go deadassign.go deadlabel.go doc.go fix.go forloop.go localid.go main.go mainret.go mem2var.go typecheck.go unresolved.go unusedvar.go varnames.go z_usage.go


internal/diffPackage diff implements a Diff function that compare two inputs using the 'diff' tool.

Package main imports 20 packages (graph). Updated 2019-11-01. Refresh now. Tools for package owners.