Created
January 15, 2012 10:01
-
-
Save xenji/1615285 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 ("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