mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-25 02:46:53 +08:00
Comments
This commit is contained in:
parent
3715452359
commit
884eda6411
13 changed files with 327 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
title: Not understanding slice length and capacity (#20)
|
title: Not understanding slice length and capacity (#20)
|
||||||
|
comments: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# Not understanding slice length and capacity
|
# Not understanding slice length and capacity
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
title: Maps and memory leaks (#28)
|
title: Maps and memory leaks (#28)
|
||||||
|
comments: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# Maps and memory leaks
|
# Maps and memory leaks
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
title: Writing inaccurate benchmarks (#89)
|
title: Writing inaccurate benchmarks (#89)
|
||||||
|
comments: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# Writing inaccurate benchmarks
|
# Writing inaccurate benchmarks
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
title: Not using Go diagnostics tooling (#98)
|
title: Not using Go diagnostics tooling (#98)
|
||||||
|
comments: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# Not using Go diagnostics tooling
|
# Not using Go diagnostics tooling
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
comments: true
|
||||||
|
---
|
||||||
|
|
||||||
# Common Go Mistakes
|
# Common Go Mistakes
|
||||||
|
|
||||||
This page is a summary of all the mistakes in the 100 Go Mistakes book. Meanwhile, it's also a page open to the community. If you believe that a mistake should be added, please create a [community mistake issue](https://github.com/teivah/100-go-mistakes/issues/new?assignees=&labels=community+mistake&template=community_mistake.md&title=).
|
This page is a summary of all the mistakes in the 100 Go Mistakes book. Meanwhile, it's also a page open to the community. If you believe that a mistake should be added, please create a [community mistake issue](https://github.com/teivah/100-go-mistakes/issues/new?assignees=&labels=community+mistake&template=community_mistake.md&title=).
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
title: Chinese (Simplified) Version
|
title: Chinese (Simplified) Version
|
||||||
|
comments: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# 100个Go常见错误及如何避免
|
# 100个Go常见错误及如何避免
|
||||||
|
|
|
||||||
|
|
@ -923,6 +923,59 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="__comments">Comments</h2>
|
||||||
|
<!-- Insert generated snippet here -->
|
||||||
|
<script src="https://giscus.app/client.js"
|
||||||
|
data-repo="teivah/100-go-mistakes"
|
||||||
|
data-repo-id="MDEwOlJlcG9zaXRvcnkzMjA4MTg5NjI="
|
||||||
|
data-category="Discussions"
|
||||||
|
data-category-id="DIC_kwDOEx9PEs4CZQUm"
|
||||||
|
data-mapping="pathname"
|
||||||
|
data-strict="0"
|
||||||
|
data-reactions-enabled="1"
|
||||||
|
data-emit-metadata="0"
|
||||||
|
data-input-position="bottom"
|
||||||
|
data-theme="preferred_color_scheme"
|
||||||
|
data-lang="en"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async>
|
||||||
|
</script>
|
||||||
|
<!-- Synchronize Giscus theme with palette -->
|
||||||
|
<script>
|
||||||
|
var giscus = document.querySelector("script[src*=giscus]")
|
||||||
|
|
||||||
|
// Set palette on initial load
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to set theme
|
||||||
|
giscus.setAttribute("data-theme", theme)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register event handlers after documented loaded
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
var ref = document.querySelector("[data-md-component=palette]")
|
||||||
|
ref.addEventListener("change", function() {
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to change theme
|
||||||
|
var frame = document.querySelector(".giscus-frame")
|
||||||
|
frame.contentWindow.postMessage(
|
||||||
|
{ giscus: { setConfig: { theme } } },
|
||||||
|
"https://giscus.app"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -934,6 +934,59 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="__comments">Comments</h2>
|
||||||
|
<!-- Insert generated snippet here -->
|
||||||
|
<script src="https://giscus.app/client.js"
|
||||||
|
data-repo="teivah/100-go-mistakes"
|
||||||
|
data-repo-id="MDEwOlJlcG9zaXRvcnkzMjA4MTg5NjI="
|
||||||
|
data-category="Discussions"
|
||||||
|
data-category-id="DIC_kwDOEx9PEs4CZQUm"
|
||||||
|
data-mapping="pathname"
|
||||||
|
data-strict="0"
|
||||||
|
data-reactions-enabled="1"
|
||||||
|
data-emit-metadata="0"
|
||||||
|
data-input-position="bottom"
|
||||||
|
data-theme="preferred_color_scheme"
|
||||||
|
data-lang="en"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async>
|
||||||
|
</script>
|
||||||
|
<!-- Synchronize Giscus theme with palette -->
|
||||||
|
<script>
|
||||||
|
var giscus = document.querySelector("script[src*=giscus]")
|
||||||
|
|
||||||
|
// Set palette on initial load
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to set theme
|
||||||
|
giscus.setAttribute("data-theme", theme)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register event handlers after documented loaded
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
var ref = document.querySelector("[data-md-component=palette]")
|
||||||
|
ref.addEventListener("change", function() {
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to change theme
|
||||||
|
var frame = document.querySelector(".giscus-frame")
|
||||||
|
frame.contentWindow.postMessage(
|
||||||
|
{ giscus: { setConfig: { theme } } },
|
||||||
|
"https://giscus.app"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1207,6 +1207,59 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="__comments">Comments</h2>
|
||||||
|
<!-- Insert generated snippet here -->
|
||||||
|
<script src="https://giscus.app/client.js"
|
||||||
|
data-repo="teivah/100-go-mistakes"
|
||||||
|
data-repo-id="MDEwOlJlcG9zaXRvcnkzMjA4MTg5NjI="
|
||||||
|
data-category="Discussions"
|
||||||
|
data-category-id="DIC_kwDOEx9PEs4CZQUm"
|
||||||
|
data-mapping="pathname"
|
||||||
|
data-strict="0"
|
||||||
|
data-reactions-enabled="1"
|
||||||
|
data-emit-metadata="0"
|
||||||
|
data-input-position="bottom"
|
||||||
|
data-theme="preferred_color_scheme"
|
||||||
|
data-lang="en"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async>
|
||||||
|
</script>
|
||||||
|
<!-- Synchronize Giscus theme with palette -->
|
||||||
|
<script>
|
||||||
|
var giscus = document.querySelector("script[src*=giscus]")
|
||||||
|
|
||||||
|
// Set palette on initial load
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to set theme
|
||||||
|
giscus.setAttribute("data-theme", theme)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register event handlers after documented loaded
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
var ref = document.querySelector("[data-md-component=palette]")
|
||||||
|
ref.addEventListener("change", function() {
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to change theme
|
||||||
|
var frame = document.querySelector(".giscus-frame")
|
||||||
|
frame.contentWindow.postMessage(
|
||||||
|
{ giscus: { setConfig: { theme } } },
|
||||||
|
"https://giscus.app"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1241,6 +1241,59 @@ world” is executed, which occupies the four CPU cores for approximately 40 ms.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="__comments">Comments</h2>
|
||||||
|
<!-- Insert generated snippet here -->
|
||||||
|
<script src="https://giscus.app/client.js"
|
||||||
|
data-repo="teivah/100-go-mistakes"
|
||||||
|
data-repo-id="MDEwOlJlcG9zaXRvcnkzMjA4MTg5NjI="
|
||||||
|
data-category="Discussions"
|
||||||
|
data-category-id="DIC_kwDOEx9PEs4CZQUm"
|
||||||
|
data-mapping="pathname"
|
||||||
|
data-strict="0"
|
||||||
|
data-reactions-enabled="1"
|
||||||
|
data-emit-metadata="0"
|
||||||
|
data-input-position="bottom"
|
||||||
|
data-theme="preferred_color_scheme"
|
||||||
|
data-lang="en"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async>
|
||||||
|
</script>
|
||||||
|
<!-- Synchronize Giscus theme with palette -->
|
||||||
|
<script>
|
||||||
|
var giscus = document.querySelector("script[src*=giscus]")
|
||||||
|
|
||||||
|
// Set palette on initial load
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to set theme
|
||||||
|
giscus.setAttribute("data-theme", theme)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register event handlers after documented loaded
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
var ref = document.querySelector("[data-md-component=palette]")
|
||||||
|
ref.addEventListener("change", function() {
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to change theme
|
||||||
|
var frame = document.querySelector(".giscus-frame")
|
||||||
|
frame.contentWindow.postMessage(
|
||||||
|
{ giscus: { setConfig: { theme } } },
|
||||||
|
"https://giscus.app"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4161,6 +4161,59 @@ the use case. However, we should see the two options as complementary. </p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="__comments">Comments</h2>
|
||||||
|
<!-- Insert generated snippet here -->
|
||||||
|
<script src="https://giscus.app/client.js"
|
||||||
|
data-repo="teivah/100-go-mistakes"
|
||||||
|
data-repo-id="MDEwOlJlcG9zaXRvcnkzMjA4MTg5NjI="
|
||||||
|
data-category="Discussions"
|
||||||
|
data-category-id="DIC_kwDOEx9PEs4CZQUm"
|
||||||
|
data-mapping="pathname"
|
||||||
|
data-strict="0"
|
||||||
|
data-reactions-enabled="1"
|
||||||
|
data-emit-metadata="0"
|
||||||
|
data-input-position="bottom"
|
||||||
|
data-theme="preferred_color_scheme"
|
||||||
|
data-lang="en"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async>
|
||||||
|
</script>
|
||||||
|
<!-- Synchronize Giscus theme with palette -->
|
||||||
|
<script>
|
||||||
|
var giscus = document.querySelector("script[src*=giscus]")
|
||||||
|
|
||||||
|
// Set palette on initial load
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to set theme
|
||||||
|
giscus.setAttribute("data-theme", theme)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register event handlers after documented loaded
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
var ref = document.querySelector("[data-md-component=palette]")
|
||||||
|
ref.addEventListener("change", function() {
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to change theme
|
||||||
|
var frame = document.querySelector(".giscus-frame")
|
||||||
|
frame.contentWindow.postMessage(
|
||||||
|
{ giscus: { setConfig: { theme } } },
|
||||||
|
"https://giscus.app"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -2904,6 +2904,59 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h2 id="__comments">Comments</h2>
|
||||||
|
<!-- Insert generated snippet here -->
|
||||||
|
<script src="https://giscus.app/client.js"
|
||||||
|
data-repo="teivah/100-go-mistakes"
|
||||||
|
data-repo-id="MDEwOlJlcG9zaXRvcnkzMjA4MTg5NjI="
|
||||||
|
data-category="Discussions"
|
||||||
|
data-category-id="DIC_kwDOEx9PEs4CZQUm"
|
||||||
|
data-mapping="pathname"
|
||||||
|
data-strict="0"
|
||||||
|
data-reactions-enabled="1"
|
||||||
|
data-emit-metadata="0"
|
||||||
|
data-input-position="bottom"
|
||||||
|
data-theme="preferred_color_scheme"
|
||||||
|
data-lang="en"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async>
|
||||||
|
</script>
|
||||||
|
<!-- Synchronize Giscus theme with palette -->
|
||||||
|
<script>
|
||||||
|
var giscus = document.querySelector("script[src*=giscus]")
|
||||||
|
|
||||||
|
// Set palette on initial load
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to set theme
|
||||||
|
giscus.setAttribute("data-theme", theme)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register event handlers after documented loaded
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
var ref = document.querySelector("[data-md-component=palette]")
|
||||||
|
ref.addEventListener("change", function() {
|
||||||
|
var palette = __md_get("__palette")
|
||||||
|
if (palette && typeof palette.color === "object") {
|
||||||
|
var theme = palette.color.scheme === "slate"
|
||||||
|
? "transparent_dark"
|
||||||
|
: "light"
|
||||||
|
|
||||||
|
// Instruct Giscus to change theme
|
||||||
|
var frame = document.querySelector(".giscus-frame")
|
||||||
|
frame.contentWindow.postMessage(
|
||||||
|
{ giscus: { setConfig: { theme } } },
|
||||||
|
"https://giscus.app"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue