Repository navigation
Conversation
it may be unclear whether struct or struct pointers are mutable. mutation via the struct reference and then printing via the pointer will add clarity.
eliben
reviewed
Sep 7, 2026
| fmt.Println(sp.age) | ||
|
|
||
| // Structs are mutable. | ||
| sp.age = 51 |
Collaborator
There was a problem hiding this comment.
I would maybe move the mutable part before the pointer part.
- Show structs are mutable with
s - Then in the "pointers" section, show both access and mutation one after another, through
sp
Author
|
Feel free to close this PR and raise another instead.
…On Mon, 7 Sep 2026, at 19:22, Eli Bendersky wrote:
***@***.**** commented on this pull request.
In examples/structs/structs.go <#679 (comment)>:
> @@ -50,7 +50,7 @@ func main() {
fmt.Println(sp.age)
// Structs are mutable.
- sp.age = 51
I would maybe move the mutable part before the pointer part.
1. Show structs are mutable with `s`
2. Then in the "pointers" section, show both access and mutation one after another, through `sp`
—
Reply to this email directly, view it on GitHub <#679?email_source=notifications&email_token=AAPMQSZPRHTQ6GW43MLPOFT5N24SDA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMJTGI3TAMZRGYY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-5132703161>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAPMQSZLFHO6HUYEV3SJCPL5N24SDAVCNFSNUABDKJSXA33TNF2G64TZHM2TQOJWGQZTOO2JONZXKZJ3GUZTMMBUGM4DQOBYUF3AE>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS <https://github.com/notifications/mobile/ios/AAPMQS2UQ7MMJ2A4R3OY7JD5N24SDA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMJTGI3TAMZRGYY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG> and Android <https://github.com/notifications/mobile/android/AAPMQS2SFULSVM4IY4CHBW35N24SDA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMJTGI3TAMZRGYY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>. Download it today!
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
eliben
added a commit
that referenced
this pull request
Sep 7, 2026
Based on initial suggestion in #679
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
it may be unclear whether struct or struct pointers are mutable.
mutation via the struct reference and then printing via the pointer will add clarity.