Go+ Code Style
TODO
Specification
No package main
package main
func f() {
}
will be converted into:
func f() {
}
No func main
package main
func main() {
a := 0
}
will be converted into:
a := 0
Replace fmt.Print to builtin (NotImpl)
import "fmt"
n, err := fmt.Println("Hello world")
will be converted into:
n, err := println("Hello world")
Note:
- Convert
fmt.Print => print
- Convert
fmt.Printf => printf
- Convert
fmt.Println => println
- ...
Command style first (NotImpl)
import "fmt"
fmt.Println()
fmt.Println(fmt.Println("Hello world"))
will be converted into:
println
println println("Hello world")
Note:
- Only the outermost function call statement is converted into command style. So
fmt.Println(fmt.Println("Hello world")) is converted into println println("Hello world"), not println println "Hello world".
Function call starting with lowercase (NotImpl)
import "math"
println math.Sin(math.Pi/3)
will be converted into:
println math.sin(math.Pi/3)