Last active
August 29, 2015 14:01
-
-
Save wingyplus/c69d6c8ca3535e75e263 to your computer and use it in GitHub Desktop.
Go Format rewrite rule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gofmt -r 'a[b:len(a)] -> a[b:]' h.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
var a = []int{1, 2, 3, 4, 5} | |
var c = 2 | |
fmt.Println(a[c:]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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