lundi 2 juin 2014

undefined varible in golang


Vote count:

0




creating a CLI app that executes a predifened script using this function



func rm(file_to_be_removed) {
app := "echo"
arg0 := "-rf"
arg1 := file_to_be_removed

cmd := exec.Command(app, arg0, arg1)
out, err := cmd.Output()

if err != nil {
println(err.Error())
return
}

print(string(out))
}


problem is i get the following error when using go install to test i get this


$ ./clear-my-cache.go:8: undefined: file_to_be_removed



asked 36 secs ago






Aucun commentaire:

Enregistrer un commentaire