-
-
Save llimllib/e55c0614d3859bc51d19 to your computer and use it in GitHub Desktop.
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 ( "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