Skip to content

Instantly share code, notes, and snippets.

@xenji
Created January 15, 2012 10:01
Show Gist options
  • Save xenji/1615285 to your computer and use it in GitHub Desktop.
Save xenji/1615285 to your computer and use it in GitHub Desktop.
package main
import ("os";"runtime")
func main() {
var aFromList [2]string= [2]string{"/tmp/checkout/folder1_new","/tmp/checkout/folder2_new"}
var aToList [2]string = [2]string{"/var/www/folder1","/var/www/folder2"}
runtime.GOMAXPROCS(2)
c := make(chan int)
for k,v := range aFromList {
go move(v, aToList[k], c)
}
<-c
os.Exit(0)
}
func move(f string, t string, c chan int) {
os.Rename(f, t)
c <- 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment