Re: [go-nuts] ERRORLEVEL issue

2020-09-20 Thread Walter Weinmann
My code is here: [image: Screenshot 2020-09-21 084403.png] My script is here: [image: Screenshot 2020-09-21 084604.png] Logfile: [image: Screenshot 2020-09-21 084819.png] Same problem with os.Exit(1). What am I doing wrong? On Monday, 21 September 2020 at 05:38:11 UTC+2 Kurtis Rader wrote:

Re: [go-nuts] ERRORLEVEL issue

2020-09-20 Thread Kurtis Rader
I also wrote a trivial Go program that did nothing more than `panic("WTF")` and it results in an exit status (ERRORLEVEL) of two in both a MSYS2 bash shell and a native cmd.exe shell. So, it is likely you are not testing what you think you are testing. On Sun, Sep 20, 2020 at 7:44 PM Walter Weinma

Re: [go-nuts] ERRORLEVEL issue

2020-09-20 Thread Kurtis Rader
On Sun, Sep 20, 2020 at 7:44 PM Walter Weinmann wrote: > Sorry - unfortunately I am a beginner. > > I have a Golang program that runs on an error and ends with panic(). When > running on Windows 10 the value of ERRORLEVEL is 0, the same happens when > the program is terminated with exit(1). > > W

[go-nuts] ERRORLEVEL issue

2020-09-20 Thread Walter Weinmann
Sorry - unfortunately I am a beginner. I have a Golang program that runs on an error and ends with panic(). When running on Windows 10 the value of ERRORLEVEL is 0, the same happens when the program is terminated with exit(1). What am I doing wrong? -- You received this message because you a

Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-20 Thread Brian Candler
On Sunday, 20 September 2020 12:18:09 UTC+1, ryan embgrets wrote: > > Thanks everyone for your valuable feedback. > I was able to figure out the issue that was happening due to the > case-sensitive nature of the loginId header, which was being normalized in > golang. > > So, after adding the be

Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-20 Thread Tamás Gulácsi
Which is absolutely non-standard :) Headers are case-insensitive, so if the server relies on case, it's against the HTTP standard :) remb...@gmail.com a következőt írta (2020. szeptember 20., vasárnap, 13:18:09 UTC+2): > Thanks everyone for your valuable feedback. > I was able to figure out th

[go-nuts] Not able to run the make file of the go bare bones by achilleasa.

2020-09-20 Thread saurav deshpande
I downloaded the code from this link: https://github.com/achilleasa/bare-metal-gophers which was presented by achilleasa but when I run the make file it gives this error: *[go] compiling go sources into a standalone .o file | loadinternal: cannot find runtime/cgo | /usr/bin/ld: warning: cannot fi

Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-20 Thread ryan embgrets
Thanks everyone for your valuable feedback. I was able to figure out the issue that was happening due to the case-sensitive nature of the loginId header, which was being normalized in golang. So, after adding the below snippet i was able to make it work. req.Header["loginId"] = []string{"0610A62F

Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-20 Thread Jesper Louis Andersen
On Sun, Sep 20, 2020 at 8:10 AM burak serdar wrote: > A GET request does not have a body. > > Murky waters ahead. RFC 2616 explicitly states that a supplied body SHOULD be forwarded by the server on any request type. This has led some people to use bodies on GET requests; ElasticSearch I'm looki

Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-20 Thread Brian Candler
My suggestion is to change the URL to something you control, with http not https, and see how the requests differ using tcpdump. Here's what I get: python3 import requests r=requests.get("http://localhost/foo";, params = {'version':'5', "phoneList":"XX", "output":"json"}, header

Re: [go-nuts] hook into os.Stdout / os.Stderr

2020-09-20 Thread 'Axel Wagner' via golang-nuts
As os.Stdout/os.Stderr are *os.File, not io.Writer, you need to go a step further and use os.Pipe . Something like this: https://play.golang.org/p/V6ygCmwlsiz TBH, it's not great to do this. As you can tell from the code, this is pretty complicated and if you want e

Re: [go-nuts] Re: Get request send me hmtl content but works fine from python and curl

2020-09-20 Thread Tamás Gulácsi
Log the Python request, to see what it really sends - or recreate it with curl, which is easier to debug (--trace). remb...@gmail.com a következőt írta (2020. szeptember 20., vasárnap, 8:19:57 UTC+2): > Thanks for taking time to answer my question. I have put the actual data > except the login