access elements within a tuple. any
suggestions in Go?
On Tuesday, January 17, 2017 at 10:50:51 AM UTC-8, Deepak Jain wrote:
>
> Thanks for pointing to
> https://github.com/juju/utils/blob/master/fs/copy.go
>
>
> I was testing Copy function that recursively copies directories. I
/p/F1YHzQL4UN
>
>
> On 16 January 2017 at 21:35, Deepak Jain >
> wrote:
> > util.ExecuteCommandWithOuput(exec.Command("cp", "-r", "./*.json",
> > artifact.dir))
> >
> > func ExecuteCommandWithOuput(cmd *exec.Cmd) {
> &
Output:
Cmd:[cp -r /Users/userId/sd101 /./*.json myartifact]
exit status 1: cp: /Users/userId/sd101
/./*.json: No such file or directory
I believed that above change should have worked.
Any suggestions ?
Appreciate your time.
On Monday, January 16, 2017 at 7:35:57 PM UTC-8, Deepak Jain wrote:
s, it just invokes commands.
> 3. This depends on exactly what it is that you are trying to achieve.
>
> [1]https://golang.org/pkg/path/filepath/#Glob
>
> On Mon, 2017-01-16 at 13:35 -0800, Deepak Jain wrote:
> > util.ExecuteCommandWithOuput(exec.Command("cp"
util.ExecuteCommandWithOuput(exec.Command("cp", "-r", "./*.json", artifact.
dir))
func ExecuteCommandWithOuput(cmd *exec.Cmd) {
output, err := cmd.Output()
if err != nil {
log.Print("Error executing ", cmd.Args, err)
}
fmt.Print(string(output))
}
Output
2017/01/16 13:26:35 Error executing [cp -