Re: [go-nuts] More details regarding changes to time.Time JSON marshalling/unmarshalling in 1.20?

2023-01-04 Thread 'Dan Kortschak' via golang-nuts
On Tue, 2023-01-03 at 20:50 -0800, 'Ben Brcan' via golang-nuts wrote:
> Hi, I noticed this in the draft release notes for 1.20:
>
> The Time.MarshalJSON and Time.UnmarshalJSON methods are now more
> strict about adherence to RFC 3339.
>
> Can we get some further details about this? Are there things that
> were OK before that will no longer be valid?
>
> Thank you
>
> Ben

I'd say it's this:
https://github.com/golang/go/commit/72c58fb77192f7d17d87663c943360a48aae11dc

-- 
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/4f94fa7af4c6b15797f3d273e52d4eb1c60bee4b.camel%40kortschak.io.


[go-nuts] Re: More details regarding changes to time.Time JSON marshalling/unmarshalling in 1.20?

2023-01-04 Thread gbarr
By reading the commit at 
https://github.com/golang/go/commit/72c58fb77192f7d17d87663c943360a48aae11dc 
the change that stands out most to me is bounds checking on the hour and 
minute elements of the time zone offset

On Wednesday, January 4, 2023 at 7:54:50 AM UTC Ben Brcan wrote:

> Hi, I noticed this in the draft release notes for 1.20:
>
> *The Time.MarshalJSON 
>  and Time.UnmarshalJSON 
>  methods are now more 
> strict about adherence to RFC 3339.*
>
> Can we get some further details about this? Are there things that were OK 
> before that will no longer be valid?
>
> Thank you
>
> Ben
>

-- 
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/65b57a39-570a-42b2-afb2-287044caf64dn%40googlegroups.com.


[go-nuts] Re: What happened if http timeout happened but the request is still sent out

2023-01-04 Thread w54n
If the connection to the server is lost while transmission, you will 
probably receive a broken pipe error.
If the timeout happens before sending data, nothing to care.
If the timeout happens during data transmission, well, you may have 
incomplete data(corrupted) in the server.

I don't think there is any way to prevent such thing in the std library 
itself. Your server must be capable to handle state properly, validate what 
it is receiving and decide if it should keep it or not, thus, yes, this is 
all application layer logic.

I think this all relates to how your server will treat idempotence and 
atomic writes. 

On Tuesday, January 3, 2023 at 8:10:03 AM UTC+1 xieyu...@gmail.com wrote:

> Hi, recently I wondered the question about what would happen if http 
> timeout but the request is still sent out.
> The motive is, let's assume we make a post request with a timeout. When 
> timeout, the request is canceled, and the server won't serve it anymore.
>  However, if the request is sent out when timeout, the server actually 
> proceeds it anyway, which may make an unexpected error. 
> So I would like to know how to avoid such an error. Do we need to 
> additional check in the application layer, or could we check it inside the 
> http library?
>
> I triggered the timeout by debugger breakpoint in goland, I set the 
> breakpoint at err = pc.bw.Flush() 
> 
>  in 
> writeLoop and n, err = w.pc.conn.Write(p) 
> 
> .
> In my opinion, the socket is closed once the timeout happens, and the  n, 
> err = w.pc.conn.Write(p) 
> 
>  will 
> always fail as *use of closed network connection*.
> However, the result is it could send out the bytes, I guess it's caused by 
> the debugger, but have no idea about it.
> [image: Image Pasted at 2023-1-3 15-09.png]
>
>
>

-- 
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/07decabd-a747-48d5-92b4-93d0b88d8eccn%40googlegroups.com.


[go-nuts] Re: What happened if http timeout happened but the request is still sent out

2023-01-04 Thread Vladimir Varankin
> If the connection to the server is lost while transmission, you will 
probably receive a broken pipe error.
> If the timeout happens before sending data, nothing to care.
> If the timeout happens during data transmission, well, you may have 
incomplete data(corrupted) in the server.

In addition to the cases above, there may be a situation when the server 
received the request fully, but didn't send the response back yet, and the 
client has dropped (e.g. timeouted).
I don't think there is "a correct" behaviour for that on the HTTP side. The 
application's parties (both client and server) must agree on their own 
rules for handling (or ignoring) such cases.

On Wednesday, January 4, 2023 at 11:02:49 AM UTC+1 w54n wrote:

> If the connection to the server is lost while transmission, you will 
> probably receive a broken pipe error.
> If the timeout happens before sending data, nothing to care.
> If the timeout happens during data transmission, well, you may have 
> incomplete data(corrupted) in the server.
>
> I don't think there is any way to prevent such thing in the std library 
> itself. Your server must be capable to handle state properly, validate what 
> it is receiving and decide if it should keep it or not, thus, yes, this is 
> all application layer logic.
>
> I think this all relates to how your server will treat idempotence and 
> atomic writes. 
>
> On Tuesday, January 3, 2023 at 8:10:03 AM UTC+1 xieyu...@gmail.com wrote:
>
>> Hi, recently I wondered the question about what would happen if http 
>> timeout but the request is still sent out.
>> The motive is, let's assume we make a post request with a timeout. When 
>> timeout, the request is canceled, and the server won't serve it anymore.
>>  However, if the request is sent out when timeout, the server actually 
>> proceeds it anyway, which may make an unexpected error. 
>> So I would like to know how to avoid such an error. Do we need to 
>> additional check in the application layer, or could we check it inside the 
>> http library?
>>
>> I triggered the timeout by debugger breakpoint in goland, I set the 
>> breakpoint at err = pc.bw.Flush() 
>> 
>>  in 
>> writeLoop and n, err = w.pc.conn.Write(p) 
>> 
>> .
>> In my opinion, the socket is closed once the timeout happens, and the  n, 
>> err = w.pc.conn.Write(p) 
>> 
>>  will 
>> always fail as *use of closed network connection*.
>> However, the result is it could send out the bytes, I guess it's caused 
>> by the debugger, but have no idea about it.
>> [image: Image Pasted at 2023-1-3 15-09.png]
>>
>>
>>

-- 
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/cc2e6647-cb17-4561-9897-73e3d97c4733n%40googlegroups.com.


[go-nuts] Go 1.20 Release Candidate 2 is released

2023-01-04 Thread announce
Hello gophers,

We have just released go1.20rc2, a release candidate version of Go 1.20.
It is cut from release-branch.go1.20 at the revision tagged go1.20rc2.

Please try your production load tests and unit tests with the new version.
Your help testing these pre-release versions is invaluable.

Report any problems using the issue tracker:
https://go.dev/issue/new

If you have Go installed already, an easy way to try go1.20rc2
is by using the go command:
$ go install golang.org/dl/go1.20rc2@latest
$ go1.20rc2 download

You can download binary and source distributions from the usual place:
https://go.dev/dl/#go1.20rc2

To find out what has changed in Go 1.20, read the draft release notes:
https://tip.golang.org/doc/go1.20

Cheers,
Heschi and Dmitri for the Go team

-- 
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/lC10v9f2Q1Gwzt9LIh43Iw%40geopod-ismtpd-canary-0.


Re: [go-nuts] go get created directories with exclamation points

2023-01-04 Thread Marcin Romaszewicz
Go converts uppercase characters to the corresponding lower case character
with an exclamation point in front of it to avoid case sensitivity
collisions on case insensitive filesystems. In my pkg/mod/github directory,
DataDog is the worst offender since it has changed capitalization over
time, so I have a "!d!a!t!a-!d!o!g" and a "!data!dog" directory, for
example. It's working as intended. I don't use Intellij for Go, but I've
had no problems with GoLand, also from JetBrains, since it knows how to
handle those escaped capital letters.

-- Marcin

On Wed, Jan 4, 2023 at 8:30 AM Dean Schulze 
wrote:

> I did go get to download some Azure SDK for Go modules.  This created
> directories with exclamation points in their names.  My code works from the
> command line, but Intellij won't recognize these modules.
>
> Why does go get create directories with exclamation points in their names?
>
>
> --
> 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/9bec22e0-2a18-4cb4-b1d8-6c1e9848a58en%40googlegroups.com
> 
> .
>

-- 
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/CA%2Bv29LvO5md89s%2B-tSRK8oDUnnGP-TwwKOLdnaNRcg06RFqWmQ%40mail.gmail.com.


Re: [go-nuts] go get created directories with exclamation points

2023-01-04 Thread Dean Schulze
Thanks for that.

It turns out that Intellij's problem was that it doesn't enable Go module 
support when you create a new project from sources that include a go.mod 
file.  You have to enable Go module support manually.

I thought Intellij had fixed that bit of stupidity last year.


On Wednesday, January 4, 2023 at 9:57:56 AM UTC-7 mar...@gmail.com wrote:

> Go converts uppercase characters to the corresponding lower case character 
> with an exclamation point in front of it to avoid case sensitivity 
> collisions on case insensitive filesystems. In my pkg/mod/github directory, 
> DataDog is the worst offender since it has changed capitalization over 
> time, so I have a "!d!a!t!a-!d!o!g" and a "!data!dog" directory, for 
> example. It's working as intended. I don't use Intellij for Go, but I've 
> had no problems with GoLand, also from JetBrains, since it knows how to 
> handle those escaped capital letters.
>
> -- Marcin
>
> On Wed, Jan 4, 2023 at 8:30 AM Dean Schulze  wrote:
>
>> I did go get to download some Azure SDK for Go modules.  This created 
>> directories with exclamation points in their names.  My code works from the 
>> command line, but Intellij won't recognize these modules.
>>
>> Why does go get create directories with exclamation points in their names?
>>
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/9bec22e0-2a18-4cb4-b1d8-6c1e9848a58en%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/f6f71dd0-2520-4187-bc1a-c525fca45b8en%40googlegroups.com.


[go-nuts] Re: More details regarding changes to time.Time JSON marshalling/unmarshalling in 1.20?

2023-01-04 Thread 'Ben Brcan' via golang-nuts
That's really helpful, thank you!

On Wednesday, January 4, 2023 at 7:13:52 PM UTC+11 gbarr wrote:

> By reading the commit at 
> https://github.com/golang/go/commit/72c58fb77192f7d17d87663c943360a48aae11dc 
> the change that stands out most to me is bounds checking on the hour and 
> minute elements of the time zone offset
>
> On Wednesday, January 4, 2023 at 7:54:50 AM UTC Ben Brcan wrote:
>
>> Hi, I noticed this in the draft release notes for 1.20:
>>
>> *The Time.MarshalJSON 
>>  and Time.UnmarshalJSON 
>>  methods are now more 
>> strict about adherence to RFC 3339.*
>>
>> Can we get some further details about this? Are there things that were OK 
>> before that will no longer be valid?
>>
>> Thank you
>>
>> Ben
>>
>

-- 
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/0345303a-085f-4607-aa59-8693fc82ccd2n%40googlegroups.com.


[go-nuts] Re: CGO core dump analysis using GDB

2023-01-04 Thread mariappan balraj
Hello Go Experts,
Can someone please help on this? When we invoke CGO and there is a crash in 
C code, is it possible to get the complete C stack details to debug the 
problem? I am not seeing much information regarding this.

Best Regards
Mariappan

On Friday, December 23, 2022 at 3:27:51 AM UTC+5:30 mariappan balraj wrote:

> Hi,
>
> I have following programming where making CGO from GO code. test3() is 
> called from Go code. Which calls test2() and which calls test1(). In 
> test1(), there is a NULL pointer assignment. I could able to generate the 
> core dump when running the program. But when I use gdb, I am not getting 
> the stack trace. Can someone please help?
>
> package main
>
> /*
>
> void test1(void) {
>
>int *p = (int*)NULL;
>
>*p = 30;
>
> }
>
>
> void test2(void) { 
>
> test1();
>
> }
>
>
> void test3(void) { 
>
> test2();
>
> }
>
> */
>
> import "C"
>
>
> func main() {
>
> C.test3();
>
> }
>
> Best Regards
>
> Mariappan
>

-- 
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/f4c9c45e-3847-47f4-a664-23e684fcf1e9n%40googlegroups.com.