RE: [go-nuts] some incorrect code in blog.

2021-11-25 Thread Fannie Zhang
OK, I see. Thank you.

From: Kurtis Rader 
Sent: Thursday, November 25, 2021 10:26 AM
To: Fannie Zhang 
Cc: golang-nuts 
Subject: Re: [go-nuts] some incorrect code in blog.

Notice the date of that blog article: 2010-08-04. It's more than eleven years 
old. Blog articles are not updated as the language changes. However, in this 
case the example in that article is correct. If `os.Open()` returns an error 
then the `src` return value is invalid.

On Wed, Nov 24, 2021 at 6:14 PM Fannie Zhang 
mailto:fannie.zh...@arm.com>> wrote:
Hi all,

There is some incorrect code in https://go.dev/blog/defer-panic-and-recover 
blog.

The original code is
func CopyFile() {
   ...
   if err != nil {
  return
   }
   defer src.Close()
   ...
}

I think the correct code should be
func CopyFile() {
   ...
   defer src.Close()
   if err != nil {
  return
   }
   ...
}

I do not know how to modify the go blog, can anyone help? Thank you.

Best regards,
Fannie Zhang
--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
golang-nuts+unsubscr...@googlegroups.com<mailto:golang-nuts+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/726e95ed-9b14-46a5-bb09-7821616f4ff9n%40googlegroups.com<https://groups.google.com/d/msgid/golang-nuts/726e95ed-9b14-46a5-bb09-7821616f4ff9n%40googlegroups.com?utm_medium=email_source=footer>.


--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/PAXPR08MB6640963981E13AC180B4E19594629%40PAXPR08MB6640.eurprd08.prod.outlook.com.


[go-nuts] some incorrect code in blog.

2021-11-24 Thread Fannie Zhang
Hi all,

There is some incorrect code in https://go.dev/blog/defer-panic-and-recover 
blog.

The original code is
*func CopyFile() {*
*   ...*
*   if err != nil {*
*  return*
*   }*
*   defer src.Close()*
*   ...*
*}*

I think the correct code should be
*func CopyFile() {*
*   ...*
*   defer src.Close()*
*   if err != nil {*
*  return*
*   }*
*   ...*
*}*

I do not know how to modify the go blog, can anyone help? Thank you.

Best regards,
Fannie Zhang

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/726e95ed-9b14-46a5-bb09-7821616f4ff9n%40googlegroups.com.


[go-nuts] Re: what is asm6 and span6 for?

2021-03-30 Thread Fannie Zhang
On Monday, March 29, 2021 at 10:45:01 PM UTC+8 cuiw...@gmail.com wrote:

> https://github.com/golang/go/blob/master/src/cmd/internal/obj/x86/asm6.go
> this file named asm6, and there is a func named span6, what is 6 for here?
>

It is the assembler for amd64 and 386 architecture. Please see the code 
https://github.com/golang/go/blob/a95454b6f31a982f064d262987199fba19f085e9/src/cmd/internal/obj/x86/obj6.go#L1403.
 

Fannie

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3cf3d244-41a6-4db3-a31c-edbc8eff32f4n%40googlegroups.com.