mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-20 16:45:56 +08:00
Announce
This commit is contained in:
parent
8d85d6cdef
commit
a6c4ae916d
21 changed files with 266 additions and 259 deletions
|
|
@ -1,5 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block announce %}
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -1190,7 +1190,7 @@
|
|||
<li><code>io.Writer</code> writes data to a target</li>
|
||||
</ul>
|
||||
<p>What is the rationale for having these two interfaces in the language? What is the point of creating these abstractions?</p>
|
||||
<p>Let’s assume we need to implement a function that should copy the content of one file to another. We could create a specific function that would take as input two <code>*os.Files</code>. Or, we can choose to create a more generic function using <code>io.Reader</code> and <code>io.Writer</code> abstractions:</p>
|
||||
<p>Let’s assume we need to implement a function that should copy the content of one file to another. We could create a specific function that would take as input two <code>*os.File</code>. Or, we can choose to create a more generic function using <code>io.Reader</code> and <code>io.Writer</code> abstractions:</p>
|
||||
<div class="language-go highlight"><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="kd">func</span><span class="w"> </span><span class="nx">copySourceToDest</span><span class="p">(</span><span class="nx">source</span><span class="w"> </span><span class="nx">io</span><span class="p">.</span><span class="nx">Reader</span><span class="p">,</span><span class="w"> </span><span class="nx">dest</span><span class="w"> </span><span class="nx">io</span><span class="p">.</span><span class="nx">Writer</span><span class="p">)</span><span class="w"> </span><span class="kt">error</span><span class="w"> </span><span class="p">{</span>
|
||||
</span><span id="__span-2-2"><a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="w"> </span><span class="c1">// ...</span>
|
||||
</span><span id="__span-2-3"><a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a><span class="p">}</span>
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
2
site/external/index.html
vendored
2
site/external/index.html
vendored
|
|
@ -135,7 +135,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -5087,7 +5087,7 @@ the use case. However, we should see the two options as complementary. </p>
|
|||
</span><span id="__span-70-10"><a id="__codelineno-70-10" name="__codelineno-70-10" href="#__codelineno-70-10"></a><span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="nx">i</span><span class="p">)</span>
|
||||
</span><span id="__span-70-11"><a id="__codelineno-70-11" name="__codelineno-70-11" href="#__codelineno-70-11"></a><span class="p">}</span>
|
||||
</span></code></pre></div>
|
||||
<p>Runnig this code with the <code>-race</code> logs the following warning:</p>
|
||||
<p>Running this code with the <code>-race</code> logs the following warning:</p>
|
||||
<div class="language-bash highlight"><pre><span></span><code><span id="__span-71-1"><a id="__codelineno-71-1" name="__codelineno-71-1" href="#__codelineno-71-1"></a><span class="o">==================</span>
|
||||
</span><span id="__span-71-2"><a id="__codelineno-71-2" name="__codelineno-71-2" href="#__codelineno-71-2"></a>WARNING:<span class="w"> </span>DATA<span class="w"> </span>RACE
|
||||
</span><span id="__span-71-3"><a id="__codelineno-71-3" name="__codelineno-71-3" href="#__codelineno-71-3"></a><span class="hll">Write<span class="w"> </span>at<span class="w"> </span>0x00c000026078<span class="w"> </span>by<span class="w"> </span>goroutine<span class="w"> </span><span class="m">7</span>:<span class="w"> </span><span class="c1"># (1)</span>
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
</button>
|
||||
|
||||
|
||||
📢 Two new full sections are now available: <a href="https://100go.co/5-interface-pollution/">#5: Interface pollution</a> and <a href="https://100go.co/92-false-sharing/">#92: Writing concurrent code that leads to false sharing</a>.
|
||||
📢 I have just released a daily newsletter for coders: The Coder Cafe ☕. Feel free to have a look at <a href="https://thecoder.cafe">thecoder.cafe</a>.
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -2,77 +2,77 @@
|
|||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://100go.co/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/20-slice/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/28-maps-memory-leaks/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/5-interface-pollution/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/56-concurrency-faster/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/89-benchmarks/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/9-generics/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/92-false-sharing/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/98-profiling-execution-tracing/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/book/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/chapter-1/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/external/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/ja/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/pt-br/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://100go.co/zh/</loc>
|
||||
<lastmod>2024-10-06</lastmod>
|
||||
<lastmod>2024-10-09</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
</urlset>
|
||||
Binary file not shown.
|
|
@ -6,3 +6,10 @@
|
|||
.md-typeset details {
|
||||
font-size: 15px
|
||||
}
|
||||
|
||||
.md-announce {
|
||||
background-color: #f0f8ff; /* Light blue background */
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
color: #333;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue