From 6bd761536630d243bfe66369136b14b88006fad6 Mon Sep 17 00:00:00 2001
From: Eli Bendersky
Date: Mon, 5 Jun 2023 05:47:05 -0700
Subject: [PATCH] Reword comment in new anon struct sample
---
examples/structs/structs.go | 5 +++--
examples/structs/structs.hash | 4 ++--
public/structs | 7 ++++---
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/examples/structs/structs.go b/examples/structs/structs.go
index 62d7cac..9f38700 100644
--- a/examples/structs/structs.go
+++ b/examples/structs/structs.go
@@ -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
diff --git a/examples/structs/structs.hash b/examples/structs/structs.hash
index 493e5b3..9da9321 100644
--- a/examples/structs/structs.hash
+++ b/examples/structs/structs.hash
@@ -1,2 +1,2 @@
-5a15014159c5c98fe5f829c483ded3914db77053
-D9lW-Dd6XQP
+2676ffa99a3a14bc99332fc498e5d658c7988612
+EzGgwrfM-yD
diff --git a/public/structs b/public/structs
index f57905f..9c34077 100644
--- a/public/structs
+++ b/public/structs
@@ -43,7 +43,7 @@ records.
- 
+ 
package main
|
@@ -227,8 +227,9 @@ pointers are automatically dereferenced.
- 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.
|
|