check source duplication

This commit is contained in:
itchyny 2020-01-08 10:42:16 +09:00
parent 1bb8c86761
commit 33a796548f

View file

@ -71,6 +71,13 @@ Options:
}
func rename(args []string) error {
xs := make(map[string]bool, len(args))
for _, src := range args {
if xs[src] {
return fmt.Errorf("duplicate source: %s", src)
}
xs[src] = true
}
f, err := ioutil.TempFile("", name+"-")
if err != nil {
return err