This commit is contained in:
Mark McGranaghan 2012-11-24 11:42:27 -08:00
parent c2754ecc79
commit 5ac5ca31c3
5 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
.anvil .anvil
**/**.pyc *.pyc

View File

@ -79,7 +79,7 @@ function.</p>
<tr> <tr>
<td class="docs"> <td class="docs">
<p>For our example we&rsquo;ll exec <code>ls</code>. Go requires an <p>For our example we&rsquo;ll exec <code>ls</code>. Go requires an
abolute path to the binary we want to execute, so absolute path to the binary we want to execute, so
we&rsquo;ll use <code>exec.LookPath</code> to find it (probably we&rsquo;ll use <code>exec.LookPath</code> to find it (probably
<code>/bin/ls</code>).</p> <code>/bin/ls</code>).</p>
@ -125,7 +125,7 @@ environment.</p>
<tr> <tr>
<td class="docs"> <td class="docs">
<p>Here&rsquo;s the actual <code>os.Exec</code> call. If this call is <p>Here&rsquo;s the actual <code>os.Exec</code> call. If this call is
succesful, the execution of our process will end successful, the execution of our process will end
here and be replaced by the <code>/bin/ls -a -l -h</code> here and be replaced by the <code>/bin/ls -a -l -h</code>
process. If there is an error we&rsquo;ll get a return process. If there is an error we&rsquo;ll get a return
value.</p> value.</p>

View File

@ -112,7 +112,7 @@ the indexes though.</p>
</td> </td>
<td class="code leading"> <td class="code leading">
<div class="highlight"><pre> <span class="nx">kvs</span> <span class="o">:=</span> <span class="kd">map</span><span class="p">[</span><span class="kt">string</span><span class="p">]</span><span class="kt">string</span><span class="p">{</span><span class="s">&quot;a&quot;</span><span class="p">:</span> <span class="s">&quot;apple&quot;</span><span class="p">,</span> <span class="s">&quot;b&quot;</span><span class="p">:</span> <span class="s">&quot;bannana&quot;</span><span class="p">}</span> <div class="highlight"><pre> <span class="nx">kvs</span> <span class="o">:=</span> <span class="kd">map</span><span class="p">[</span><span class="kt">string</span><span class="p">]</span><span class="kt">string</span><span class="p">{</span><span class="s">&quot;a&quot;</span><span class="p">:</span> <span class="s">&quot;apple&quot;</span><span class="p">,</span> <span class="s">&quot;b&quot;</span><span class="p">:</span> <span class="s">&quot;banana&quot;</span><span class="p">}</span>
<span class="k">for</span> <span class="nx">k</span><span class="p">,</span> <span class="nx">v</span> <span class="o">:=</span> <span class="k">range</span> <span class="nx">kvs</span> <span class="p">{</span> <span class="k">for</span> <span class="nx">k</span><span class="p">,</span> <span class="nx">v</span> <span class="o">:=</span> <span class="k">range</span> <span class="nx">kvs</span> <span class="p">{</span>
<span class="nx">fmt</span><span class="p">.</span><span class="nx">Printf</span><span class="p">(</span><span class="s">&quot;%s -&gt; %s\n&quot;</span><span class="p">,</span> <span class="nx">k</span><span class="p">,</span> <span class="nx">v</span><span class="p">)</span> <span class="nx">fmt</span><span class="p">.</span><span class="nx">Printf</span><span class="p">(</span><span class="s">&quot;%s -&gt; %s\n&quot;</span><span class="p">,</span> <span class="nx">k</span><span class="p">,</span> <span class="nx">v</span><span class="p">)</span>
<span class="p">}</span> <span class="p">}</span>

View File

@ -192,7 +192,7 @@ accomplishes this.</p>
<tr> <tr>
<td class="docs"> <td class="docs">
<p>The <code>bufio</code> package implements a buffered <p>The <code>bufio</code> package implements a buffered
reader that may be useful both for it&rsquo;s efficiency reader that may be useful both for its efficiency
with many small reads and because of the additional with many small reads and because of the additional
reading methods it provides.</p> reading methods it provides.</p>

View File

@ -80,7 +80,7 @@ type.</p>
<p>We implement <code>sort.Interface</code> - <code>Len</code>, <code>Less</code>, and <p>We implement <code>sort.Interface</code> - <code>Len</code>, <code>Less</code>, and
<code>Swap</code> - on our type so we can use the <code>sort</code> package&rsquo;s <code>Swap</code> - on our type so we can use the <code>sort</code> package&rsquo;s
generic <code>Sort</code> function. <code>Len</code> and <code>Swap</code> generic <code>Sort</code> function. <code>Len</code> and <code>Swap</code>
will usually be similar accross types and <code>Less</code> will will usually be similar across types and <code>Less</code> will
hold the actual custom sorting logic. In our case we hold the actual custom sorting logic. In our case we
want to sort in order of increasing string length, so want to sort in order of increasing string length, so
we use <code>len(s[i])</code> and <code>len(s[j])</code> here.</p> we use <code>len(s[i])</code> and <code>len(s[j])</code> here.</p>