[go-nuts] comment conversion script? inlncmt.awk?

2020-10-02 Thread quin...@gmail.com
Hi, When I was writing C I used to use a script bcmt.awk (it might have been one of russ's or erikQ's, I cannot remember) to convert c++ style comments to K&R syle. Now I am a proud go programmer I find my fingers still want to put starts before and after my slashes when writing comments. Has

Re: [go-nuts] comment conversion script? inlncmt.awk?

2020-10-02 Thread Shulhan
> On 2 Oct 2020, at 15.05, quin...@gmail.com wrote: > > Hi, > > When I was writing C I used to use a script bcmt.awk (it might have been one > of russ's or erikQ's, I cannot remember) to convert c++ style comments to K&R > syle. Now I am a proud go programmer I find my fingers still want to

[go-nuts] Re: Proper way of mocking interfaces in unit tests - the golang way

2020-10-02 Thread Vladimir Varankin
Hey, I don't think the statement about "assert going against the best practices in go unit tests" stands against the reality, sorry. One definitely doesn't have to use a separate assertion package to write unit-tests in Go, comparing to some other programming languages. But there is really no m

[go-nuts] Re: Proper way of mocking interfaces in unit tests - the golang way

2020-10-02 Thread Jason Phillips
In the general case, all testify assertions are doing under the hood is call t.Errorf (see here ). If you're calling the "FailNow" set of functions that's followed by t.FailNow, which e

Re: [go-nuts] comment conversion script? inlncmt.awk?

2020-10-02 Thread quin...@gmail.com
inlncmt.awk was my joke-ey guess at what such a thing might be called, but gofmtcomment sounds just like what I want. Many thanks, -Steve On Friday, 2 October 2020 at 12:02:11 UTC+1 Shulhan wrote: > > > > On 2 Oct 2020, at 15.05,

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread Ian Lance Taylor
On Thu, Oct 1, 2020 at 10:44 PM aihui zhu wrote: > > C program could generate a core dump file, my os is Big Sur beta. Thanks. I see now that for darwin-amd64 we do not generate core dumps. Sorry for forgetting about that. We have this comment: // OS X core dumps are linear dumps of the mappe

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread aihui zhu
thank you. i see that there are also .crash file generated at ~/Library/Logs/DiagnosticReports ``` ➜ ~ ls Library/Logs/DiagnosticReports/a.out_2020-10-02-1337* -lh -rw--- 1 zah _analyticsusers 22K Oct 2 13:37 Library/Logs/DiagnosticReports/a.out_2020-10-02-133721_hac.crash -rw--- 1 zah

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread Kurtis Rader
On Fri, Oct 2, 2020 at 5:29 PM aihui zhu wrote: > thank you. i see that there are also .crash file generated at > ~/Library/Logs/DiagnosticReports > ``` > ➜ ~ ls Library/Logs/DiagnosticReports/a.out_2020-10-02-1337* -lh > -rw--- 1 zah _analyticsusers 22K Oct 2 13:37 > Library/Logs/Diagnost

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread Kurtis Rader
On Fri, Oct 2, 2020 at 12:26 PM Ian Lance Taylor wrote: > On Thu, Oct 1, 2020 at 10:44 PM aihui zhu wrote: > > > > C program could generate a core dump file, my os is Big Sur beta. > > Thanks. > > I see now that for darwin-amd64 we do not generate core dumps. Sorry > for forgetting about that.

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread aihui zhu
I mean that is there any way to expose SIGSEGV to macOS system just like a pure C program, so that the system could generate .crash file automatically. currently, seems that go itself catch the SIGSEGV signal, and prints go trace back, so it doesn't trigger system default behavior for SIGSEGV. p

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread Kurtis Rader
On Fri, Oct 2, 2020 at 9:23 PM aihui zhu wrote: > I mean that is there any way to expose SIGSEGV to macOS system just like a > pure C program, so that the system could generate .crash file automatically. > currently, seems that go itself catch the SIGSEGV signal, and prints go > trace back, so it

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread Robert Engels
A crash file is not a core dump. It does not contain a memory dump. > On Oct 2, 2020, at 11:36 PM, Kurtis Rader wrote: > >  >> On Fri, Oct 2, 2020 at 9:23 PM aihui zhu wrote: > >> I mean that is there any way to expose SIGSEGV to macOS system just like a >> pure C program, so that the syste

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread aihui zhu
.crash file is also acceptable for me, if it contains a stack trace. On Saturday, October 3, 2020 at 12:41:58 PM UTC+8 ren...@ix.netcom.com wrote: > A crash file is not a core dump. It does not contain a memory dump. > > On Oct 2, 2020, at 11:36 PM, Kurtis Rader wrote: > >  > > On Fri, Oct 2,

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread Kurtis Rader
On Fri, Oct 2, 2020 at 9:41 PM Robert Engels wrote: > A crash file is not a core dump. It does not contain a memory dump. > Yes. I addressed that in a different reply than the one you responded to. So I'm a wee bit confused what to take away from your comment, Robert. :-) -- Kurtis Rader Caret

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread Kurtis Rader
On Fri, Oct 2, 2020 at 9:49 PM aihui zhu wrote: > .crash file is also acceptable for me, if it contains a stack trace. > No, it does not. At least not for me when running a trivial C program that simply dereferences a NULL pointer. It does contain some information (e.g., the contents of the CPU

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-02 Thread aihui zhu
thank you and yes, i'm trying to debug a SIGSEGV occurred in C code. i'm going changed my C code to some other way, since it's a bit difficult to retrieve the stack trace for debugging.. On Saturday, October 3, 2020 at 1:12:36 PM UTC+8 Kurtis Rader wrote: > On Fri, Oct 2, 2020 at 9:49 PM aihui