File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1425,19 +1425,17 @@ the language specification.)
1425
1425
Even in cases where the compiler could take the address of a value
1426
1426
to pass to the method, if the method modifies the value the changes
1427
1427
will be lost in the caller.
1428
- As an example, if the ` Write ` method of
1429
- [ ` bytes.Buffer ` ] ( /pkg/bytes/#Buffer )
1430
- used a value receiver rather than a pointer,
1431
- this code:
1428
+
1429
+ As an example, if the code below were valid:
1432
1430
1433
1431
```
1434
1432
var buf bytes.Buffer
1435
1433
io.Copy(buf, os.Stdin)
1436
1434
```
1437
1435
1438
- would copy standard input into a * copy* of ` buf ` ,
1436
+ it would copy standard input into a * copy* of ` buf ` ,
1439
1437
not into ` buf ` itself.
1440
- This is almost never the desired behavior.
1438
+ This is almost never the desired behavior and is therefore disallowed by the language .
1441
1439
1442
1440
### What happens with closures running as goroutines? {#closures_and_goroutines}
1443
1441
You can’t perform that action at this time.
0 commit comments