Instantly share code, notes, and snippets.

@llimllib /sort.go Secret
Last active Dec 25, 2015

Embed
What would you like to do?
package main
import ( "io/ioutil"; "os"; "strings"; "sort" )
func main() {
content, _ := ioutil.ReadFile(os.Args[1])
lines := strings.Split(strings.TrimSpace(string(content)), "\n")
sort.Strings(lines)
ioutil.WriteFile(os.Args[2], []byte(strings.Join(lines, "\n")), 0666)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment