Reword comment in new anon struct sample
This commit is contained in:
parent
4b9411514f
commit
6bd7615366
@ -51,8 +51,9 @@ func main() {
|
|||||||
sp.age = 51
|
sp.age = 51
|
||||||
fmt.Println(sp.age)
|
fmt.Println(sp.age)
|
||||||
|
|
||||||
// Structs don't always have to be defined as instances of types,
|
// If a struct type is only used for a single value, we don't
|
||||||
// you can define a struct anonymously.
|
// have to give it a name. The value can have an anonymous
|
||||||
|
// struct type.
|
||||||
dog := struct {
|
dog := struct {
|
||||||
name string
|
name string
|
||||||
isGood bool
|
isGood bool
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
5a15014159c5c98fe5f829c483ded3914db77053
|
2676ffa99a3a14bc99332fc498e5d658c7988612
|
||||||
D9lW-Dd6XQP
|
EzGgwrfM-yD
|
||||||
|
7
public/structs
generated
7
public/structs
generated
@ -43,7 +43,7 @@ records.</p>
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="code leading">
|
<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 class="chroma"><span class="kn">package</span> <span class="nx">main</span>
|
||||||
</pre>
|
</pre>
|
||||||
</td>
|
</td>
|
||||||
@ -227,8 +227,9 @@ pointers are automatically dereferenced.</p>
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="docs">
|
<td class="docs">
|
||||||
<p>Structs don’t always have to be defined as instances of types,
|
<p>If a struct type is only used for a single value, we don’t
|
||||||
you can define a struct anonymously.</p>
|
have to give it a name. The value can have an anonymous
|
||||||
|
struct type.</p>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="code">
|
<td class="code">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user