Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread peterGo
Ian, Hugh Myrie might be expecting to see something like this: https://go.dev/play/p/7TlD5R1C0oX Peter On Tuesday, July 2, 2024 at 9:53:41 PM UTC-4 Ian Lance Taylor wrote: On Tue, Jul 2, 2024 at 5:29 PM Hugh Myrie wrote: When I change the %s to %q in the print function I see the special

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Ian Lance Taylor
On Tue, Jul 2, 2024 at 5:29 PM Hugh Myrie wrote: > When I change the %s to %q in the print function I see the special > characters in their Hexadecimal representations. > > See below: > > 0011020240702\x1d0201758001030085245467021.00Y50072 >

Re: [go-nuts] cannot use a type parameter as RHS in type declaration

2024-07-02 Thread Ian Lance Taylor
On Tue, Jul 2, 2024 at 5:36 PM Diego Augusto Molina wrote: > > Hi everyone! I wanted to ask about the error in the title: "cannot use a type > parameter as RHS in type declaration". ... > Considering the three approaches: (A) non-generic; (B) generic with struct; > (C) generic with an array

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Hugh Myrie
Go code as plain text below: unc SendClaim(w http.ResponseWriter, r *http.Request) { // strEcho := "Halo" servAddr := tcpAddress type Resp struct { Status string `json:"status"` Reply string `json:"reply"` } type Claim struct { ClaimInfo string `json:"claiminfo"` } var params Claim erx :=

[go-nuts] cannot use a type parameter as RHS in type declaration

2024-07-02 Thread Diego Augusto Molina
Hi everyone! I wanted to ask about the error in the title: "cannot use a type parameter as RHS in type declaration". My use case: I am implementing range queries on a single dimension, and use a common type, e.g. int64. There is a method that I have to implement that is Contains(v int64) bool.

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Hugh Myrie
When I change the %s to %q in the print function I see the special characters in their Hexadecimal representations. See below: 0011020240702\x1d0201758001030085245467021.00Y50072 202407020\x1cDG\x1cDI00\x1cE7\x1cG1200 \x1cG2X \x1cG310\x1cG4E79

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Ian Lance Taylor
1) Please send Go code as plain text, not as an image. Anybody can read plain text. Images are hard to read. Thanks. 2) What do you see if you change the %s to %q in the fmt.Printf call? Ian On Tue, Jul 2, 2024 at 3:40 PM Hugh Myrie wrote: > The original Go function is shown below.

[go-nuts] Re: Go 1.21 / FIPS

2024-07-02 Thread Damien A
Michael, I am not fully sure what you mean? Can you elaborate on what you are asking me? I am not really a Go Developer just a Linux Admin who often gets tasked with trying to build packages. On Tuesday, July 2, 2024 at 10:42:06 AM UTC-7 Michael Oguidan wrote: > Hi, > Please can we dig the

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Hugh Myrie
The original Go function is shown below. Initially, a JSON-encoded string is sent from the client. The first print function is used to view the output after decoding. func SendClaim(w http.ResponseWriter, r *http.Request) { // strEcho := "Halo" servAddr := tcpAddress type Resp

[go-nuts] [security] Go 1.22.5 and Go 1.21.12 are released

2024-07-02 Thread announce
Hello gophers, We have just released Go versions 1.22.5 and 1.21.12, minor point releases. These minor releases include 1 security fixes following the security policy : - net/http: denial of service due to improper 100-continue handling The net/http

Re: [go-nuts] Should the phrasing about method sets in Go FAQ be slightly clarified?

2024-07-02 Thread Ian Lance Taylor
On Mon, Jul 1, 2024 at 8:12 AM Timur Sharapov wrote: > > https://go.dev/doc/faq#different_method_sets > > I am referring to this paragraph that in my opinion answers one of the > trickiest questions for new Go developers. > > Even in cases where the compiler could take the address of a value to

[go-nuts] Re: Go 1.21 / FIPS

2024-07-02 Thread Michael Oguidan
Hi, Please can we dig the "crypto backend" first to see? On Tuesday, July 2, 2024 at 3:45:40 PM UTC Damien A wrote: > > I have been building Grafana packages previously using Go 1.20.5 on Oracle > Enterprise Linux 9 with the following settings: > > export

[go-nuts] Go 1.21 / FIPS

2024-07-02 Thread Damien A
I have been building Grafana packages previously using Go 1.20.5 on Oracle Enterprise Linux 9 with the following settings: export IMPORTPATH=%{_builddir}/grafana-%{version} export BUILDFLAGS="-v -p 4 -x -buildmode=pie -mod=vendor" export GOPATH=%{_builddir}/go:%{_builddir}/contrib export

Re: [go-nuts] Testing specific file in a package

2024-07-02 Thread Victor Manuel “Vitu” Giordano
Thanks Arkadiusz. Good tip. El domingo, 30 de junio de 2024 a las 16:38:44 UTC-3, Arkadiusz Drabczyk escribió: > On Sat, Jun 29, 2024 at 11:14:56AM -0300, Victor Manuel Giordano wrote: > > Thank you all for the feedback. It is appreciated. > > > > • So it is not possible via the golang

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread Hugh Myrie
Copying the result to notepad confirms the missing special characters.. I'll try your suggestion. Thanks. Virus-free.www.avg.com

Re: [go-nuts] Potential Issue in errgroup

2024-07-02 Thread 'Axel Wagner' via golang-nuts
(sorry, didn't hit "Reply All", apparently) Hi, I don't believe the semaphore has anything to do with the wait group counter. So I don't believe it is relevant to this question. Note that a goroutine can be interrupted at any time anyways, so whether or not that code is there doesn't matter for

[go-nuts] Potential Issue in errgroup

2024-07-02 Thread Icey
In errgroup, the step to increment the WaitGroup counter (wg.Add) is written after acquiring a token from the semaphore (sem). Is it possible that if all goroutines finish execution and call wg.Done at nearly the same time, the currently blocked goroutines do not immediately call wg.Add due to

Re: [go-nuts] Preserving special characters when reading Go POST request body

2024-07-02 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2024-07-01 at 12:03 -0700, Hugh Myrie wrote: > I am trying to preserve special characters (group separators and > field separators) when reading the request body from a POST request. > > When I do a dumpRequest I am able to see the special characters (Hex > Format, for example: \x1c or