How to have panic messages show in a PowerShell console

140 views
Skip to first unread message

Thom BENTLEY

unread,
Feb 28, 2024, 3:20:55 PM2/28/24
to golang-nuts
Hi All, 

OS: Windows 10
GoLang: go1.6.3 windows/386

I am trying to have a go executable run and show the panics it causes in the PowerShell console.  

I think I can use GODEBUG, but all the examples I've seen so far are for Linux.
I've set that variable to paniclog=1, but nothing changed.

If I run go env, I don't see GODEBUG listed.
Thanks in advance.



The information in this email and any attachments are intended solely for the recipient(s) to whom it is addressed, and may be confidential and/or privileged. Any unauthorized distribution or copying of this transmittal or its attachments is prohibited. If you are not a named recipient or have received this email in error: (i) you should not read, disclose, or copy it, (ii) please notify the sender of your receipt by reply email and delete this email and all attachments.

Jim Idle

unread,
Feb 28, 2024, 4:34:11 PM2/28/24
to Thom BENTLEY, golang-nuts
You should upgrade your Go installation to the latest version and retry. Go 1.6.3, if that is not a typo is very old.

Jim

On Feb 28 2024, at 11:35 am, Thom BENTLEY <tben...@mdsol.com> wrote:
Hi All, 

OS: Windows 10
GoLang: go1.6.3 windows/386

I am trying to have a go executable run and show the panics it causes in the PowerShell console.  

I think I can use GODEBUG, but all the examples I've seen so far are for Linux.
I've set that variable to paniclog=1, but nothing changed.

If I run go env, I don't see GODEBUG listed.
Thanks in advance.


The information in this email and any attachments are intended solely for the recipient(s) to whom it is addressed, and may be confidential and/or privileged. Any unauthorized distribution or copying of this transmittal or its attachments is prohibited. If you are not a named recipient or have received this email in error: (i) you should not read, disclose, or copy it, (ii) please notify the sender of your receipt by reply email and delete this email and all attachments.

--
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.

BENTLEY Thom

unread,
Feb 28, 2024, 7:39:22 PM2/28/24
to golang-nuts

Thanks Jim.
At the moment, I’m using the 1.6.3 version as specified in the internal documentation the project I’m learning.
I would definitely like to upgrade go to a much later version.  Just don’t want to do it before I know it works on the specified version.

 

 

From: Jim Idle <ji...@idle.ws>
Sent: Wednesday, February 28, 2024 4:34 PM
To: BENTLEY Thom <Thom.B...@3ds.com>
Cc: golang-nuts <golan...@googlegroups.com>
Subject: Re: [go-nuts] How to have panic messages show in a PowerShell console

 

You should upgrade your Go installation to the latest version and retry. Go 1. 6. 3, if that is not a typo is very old. Jim On Feb 28 2024, at 11: 35 am, Thom BENTLEY <tbentley@ mdsol. com> wrote: Hi All, OS: Windows 10 GoLang: go1. 6. 3 windows/386I

This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data privacy policy as described on our website. Should you have any questions related to personal data protection, please contact 3DS Data Protection Officer https://www.3ds.com/privacy-policy/contact/


Kurtis Rader

unread,
Feb 28, 2024, 7:50:30 PM2/28/24
to BENTLEY Thom, golang-nuts
On Wed, Feb 28, 2024 at 4:39 PM 'BENTLEY Thom' via golang-nuts <golan...@googlegroups.com> wrote:

Thanks Jim.
At the moment, I’m using the 1.6.3 version as specified in the internal documentation the project I’m learning.
I would definitely like to upgrade go to a much later version.  Just don’t want to do it before I know it works on the specified version.


The Go backward compatibility guarantee makes it almost a certainty the project you're working on will work fine if you upgrade to the current Go release. There is always a very tiny chance the project depends on a bug that has been fixed in a newer release but that is so unlikely that I wouldn't worry about it. Also, if you upgrade to the current Go release and have problems (which is unlikely) you can always go back to the old version. The bottom line is that you are unlikely to get any meaningful assistance with an ancient Go version.

--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

jake...@gmail.com

unread,
Mar 1, 2024, 8:08:54 AM3/1/24
to golang-nuts
FWIW,  in a very simple test on Windows 10 in a powershell console, running a go executable built with go1.19 prints the panic just like in a regular cmd console.

Ian Lance Taylor

unread,
Mar 1, 2024, 9:32:22 AM3/1/24
to jake...@gmail.com, golang-nuts
On Fri, Mar 1, 2024 at 5:09 AM jake...@gmail.com <jake...@gmail.com> wrote:
>
> FWIW, in a very simple test on Windows 10 in a powershell console, running a go executable built with go1.19 prints the panic just like in a regular cmd console.

There have been a lot of changes related to Windows consoles since the
1.6 release.

Ian


> On Wednesday, February 28, 2024 at 3:20:55 PM UTC-5 Thom BENTLEY wrote:
>>
>> Hi All,
>>
>> OS: Windows 10
>> GoLang: go1.6.3 windows/386
>>
>> I am trying to have a go executable run and show the panics it causes in the PowerShell console.
>>
>> I think I can use GODEBUG, but all the examples I've seen so far are for Linux.
>> I've set that variable to paniclog=1, but nothing changed.
>>
>> If I run go env, I don't see GODEBUG listed.
>> Thanks in advance.
>>
>>
>> ________________________________
>> The information in this email and any attachments are intended solely for the recipient(s) to whom it is addressed, and may be confidential and/or privileged. Any unauthorized distribution or copying of this transmittal or its attachments is prohibited. If you are not a named recipient or have received this email in error: (i) you should not read, disclose, or copy it, (ii) please notify the sender of your receipt by reply email and delete this email and all attachments.
>
> --
> 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/53c4fa69-32cd-4111-a0d5-d545d9851bf8n%40googlegroups.com.

BENTLEY Thom

unread,
Mar 1, 2024, 9:54:34 AM3/1/24
to golang-nuts

I just discovered that the executable is created using -ldflags -H=windowsgui. 

Because of that, I need to pipe to out-text in a PowerShell to see Println output but that doesn’t show the panics.

If I remove the flags, then I can see all the output.  I don’t know if they are absolutely needed so I may not be able to remove them.
I tried a few “windows” calls to setup a console for when built with the flags.  Nothing worked so far.
And, I know I may need to move to a later version of Go to get better help.  That will need some discussion with others on my team.

 

Thanks!

 

 

--

Thom Bentley | Senior Software Engineer |Medidata, a Dassault Systèmes company

Thom.B...@3ds.com

 

 

From: <golan...@googlegroups.com> on behalf of "jake...@gmail.com" <jake...@gmail.com>
Date: Friday, March 1, 2024 at 8:09 AM
To: golang-nuts <golan...@googlegroups.com>
Subject: [go-nuts] Re: How to have panic messages show in a PowerShell console

 

FWIW, in a very simple test on Windows 10 in a powershell console, running a go executable built with go1.19 prints the panic just like in a regular cmd console. On Wednesday, February 28, 2024 at 3:20:55 PM UTC-5 Thom BENTLEY wrote: Hi All,

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/EIkq7hxS9DI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.

This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email and all attachments,

Reply all
Reply to author
Forward
0 new messages