Merge remote-tracking branch 'jingweno/master'
This commit is contained in:
commit
f097c12b25
@ -27,8 +27,10 @@ func main() {
|
|||||||
|
|
||||||
// `Exec` requires arguments in slice form (as
|
// `Exec` requires arguments in slice form (as
|
||||||
// apposed to one big string). We'll give `ls` a few
|
// apposed to one big string). We'll give `ls` a few
|
||||||
// common arguments.
|
// common arguments. It has to include the program
|
||||||
args := []string{"-a", "-l", "-h"}
|
// name as the first argument. Details see
|
||||||
|
// `man 2 execve`
|
||||||
|
args := []string{"ls", "-a", "-l", "-h"}
|
||||||
|
|
||||||
// `Exec` also needs a set of [environment variables](environment-variables)
|
// `Exec` also needs a set of [environment variables](environment-variables)
|
||||||
// to use. Here we just provide our current
|
// to use. Here we just provide our current
|
||||||
|
@ -98,11 +98,13 @@ we’ll use <code>exec.LookPath</code> to find it (probably
|
|||||||
<td class="docs">
|
<td class="docs">
|
||||||
<p><code>Exec</code> requires arguments in slice form (as
|
<p><code>Exec</code> requires arguments in slice form (as
|
||||||
apposed to one big string). We’ll give <code>ls</code> a few
|
apposed to one big string). We’ll give <code>ls</code> a few
|
||||||
common arguments.</p>
|
common arguments. It has to include the program
|
||||||
|
name as the first argument. Details see
|
||||||
|
<code>man 2 execve</code></p>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="code leading">
|
<td class="code leading">
|
||||||
<div class="highlight"><pre> <span class="nx">args</span> <span class="o">:=</span> <span class="p">[]</span><span class="kt">string</span><span class="p">{</span><span class="s">"-a"</span><span class="p">,</span> <span class="s">"-l"</span><span class="p">,</span> <span class="s">"-h"</span><span class="p">}</span>
|
<div class="highlight"><pre> <span class="nx">args</span> <span class="o">:=</span> <span class="p">[]</span><span class="kt">string</span><span class="p">{</span><span class="s">"ls"</span><span class="p">,</span> <span class="s">"-a"</span><span class="p">,</span> <span class="s">"-l"</span><span class="p">,</span> <span class="s">"-h"</span><span class="p">}</span>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user