我正在尝试构建一个用Go编写的云函数,它将使用Google的CloudFunctions基础架构中可用的ImageMagick库来将多个图像合成并处理成最终的输出图像。问题的根源是我想使用的ImageMagick函数可用,但它需要多个不同的输入才能工作。我的输入是存储桶中的对象。os/execCmd结构允许您通过使用“ExtraFiles”数组来执行此操作,而且我知道如何将这些额外文件提供给我的ImageMagick命令。但是,“ExtraFiles”数组只想存储os.File的实例,而GCPStorageClient在您打开文件时会为您提供一个“Reader”实例。backgroun
我正在尝试通过管道连接到cmd.ExtraFiles我目前有错误说cannotusecmdstdout(typeio.ReadCloser)astype[]byteinargumenttopipeR.Readcannotusecmdstdout(typeio.ReadCloser)astype[]byteinargumenttofd3.Write这是我到目前为止的gocodecmd2=exec.Command("-i","pipe:0","-i","pipe:1")cmd1:=exec.Command("command","-o","-")pipeR,pipeW,_:=os.Pipe(
我正在尝试通过管道连接到cmd.ExtraFiles我目前有错误说cannotusecmdstdout(typeio.ReadCloser)astype[]byteinargumenttopipeR.Readcannotusecmdstdout(typeio.ReadCloser)astype[]byteinargumenttofd3.Write这是我到目前为止的gocodecmd2=exec.Command("-i","pipe:0","-i","pipe:1")cmd1:=exec.Command("command","-o","-")pipeR,pipeW,_:=os.Pipe(
我阅读了golang.org的解释,它说如下。//ExtraFilesspecifiesadditionalopenfilestobeinheritedbythe//newprocess.Itdoesnotincludestandardinput,standardoutput,or//standarderror.Ifnon-nil,entryibecomesfiledescriptor3+i.////BUG:onOSX10.6,childprocessesmaysometimesinheritunwantedfds.//http://golang.org/issue/2603Extra