imjasonh / ideas

A place for me to file issues against myself for things I want to build when I'm bored
5 stars 0 forks source link

Tool to inline variables in Go source #45

Open imjasonh opened 8 years ago

imjasonh commented 8 years ago

Given some Go source like this:

a := "foo"
b := 100
c := true
s := someStruct{a, b, c}
fmt.Printf("hello %d, %v", b, s)

Inline all the inline-able variables only used once and print out:

b := 100
s := someStruct("foo", b, true}
fmt.Printf("hello %d, %v", b, s)