Skip to content

Instantly share code, notes, and snippets.

@wingyplus
Last active August 29, 2015 14:01
Show Gist options
  • Save wingyplus/c69d6c8ca3535e75e263 to your computer and use it in GitHub Desktop.
Save wingyplus/c69d6c8ca3535e75e263 to your computer and use it in GitHub Desktop.
Go Format rewrite rule
gofmt -r 'a[b:len(a)] -> a[b:]' h.go
package main
import "fmt"
func main() {
var a = []int{1, 2, 3, 4, 5}
var c = 2
fmt.Println(a[c:])
}
package main
import "fmt"
func main() {
var a = []int { 1,2,3,4,5 }
var c = 2
fmt.Println(a[c:len(a)])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment