decomp: github.com/decomp/decomp/cmd/go-post 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 ...]
  -diff
    	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:

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

deadassign
	Remove "x = x" assignments.

deadlabel
	Remove unused labels.

forloop
	Add initialization and post-statements to for-loops.

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

unresolved
	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

Directories

PathSynopsis
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.