Reword comment in new anon struct sample

This commit is contained in:
Eli Bendersky 2023-06-05 05:47:05 -07:00
parent 4b9411514f
commit 6bd7615366
3 changed files with 9 additions and 7 deletions

View File

@ -51,8 +51,9 @@ func main() {
sp.age = 51
fmt.Println(sp.age)
// Structs don't always have to be defined as instances of types,
// you can define a struct anonymously.
// If a struct type is only used for a single value, we don't
// have to give it a name. The value can have an anonymous
// struct type.
dog := struct {
name string
isGood bool

View File

@ -1,2 +1,2 @@
5a15014159c5c98fe5f829c483ded3914db77053
D9lW-Dd6XQP
2676ffa99a3a14bc99332fc498e5d658c7988612
EzGgwrfM-yD

7
public/structs generated
View File

@ -43,7 +43,7 @@ records.</p>
</td>
<td class="code leading">
<a href="https://go.dev/play/p/D9lW-Dd6XQP"><img title="Run code" src="play.png" class="run" /></a><img title="Copy code" src="clipboard.png" class="copy" />
<a href="https://go.dev/play/p/EzGgwrfM-yD"><img title="Run code" src="play.png" class="run" /></a><img title="Copy code" src="clipboard.png" class="copy" />
<pre class="chroma"><span class="kn">package</span> <span class="nx">main</span>
</pre>
</td>
@ -227,8 +227,9 @@ pointers are automatically dereferenced.</p>
<tr>
<td class="docs">
<p>Structs don&rsquo;t always have to be defined as instances of types,
you can define a struct anonymously.</p>
<p>If a struct type is only used for a single value, we don&rsquo;t
have to give it a name. The value can have an anonymous
struct type.</p>
</td>
<td class="code">