Re: [go-nuts] Inquiry about gccgo Upgrade Timeline

2024-07-12 Thread Ian Lance Taylor
On Fri, Jul 12, 2024 at 6:12 AM Tanawatra Chantaranit wrote: > > I'm interested in using gccgo and was wondering if there's any information > available regarding its upgrade timeline. Is there a specific version or > feature set planned for the next upgrade? Unfortunately I have had very

Re: [go-nuts] How does embedding without some specific methods work?

2024-07-12 Thread Ian Lance Taylor
On Fri, Jul 12, 2024 at 6:12 AM William Tang wrote: > > I’m reading the current implementation of io.Copy for TCPConn. It has a > struct called tcpConnWithoutWriteTo 3, which will cause the WriterTo casting > from a io.Reader to fail 1. How and why does it work internally? When there are two

[go-nuts] How does embedding without some specific methods work?

2024-07-12 Thread William Tang
I’m reading the current implementation of io.Copy for TCPConn. It has a struct called tcpConnWithoutWriteTo 3 , which will cause the WriterTo casting from a io.Reader to fail 1

[go-nuts] Inquiry about gccgo Upgrade Timeline

2024-07-12 Thread Tanawatra Chantaranit
Hi all, I'm interested in using gccgo and was wondering if there's any information available regarding its upgrade timeline. Is there a specific version or feature set planned for the next upgrade? Thanks, Tanawatra C. -- You received this message because you are subscribed to the Google

Re: [go-nuts] gomobile: weird dependency on dmitri.shuralyov.com/gpu/mtl

2024-07-11 Thread Kurtis Rader
Try "go mod why $dependency"; e.g., > go mod why github.com/sourcegraph/jsonrpc2 # github.com/sourcegraph/jsonrpc2 src.elv.sh/pkg/lsp github.com/sourcegraph/jsonrpc2 There's also "go mod graph". On Thu, Jul 11, 2024 at 4:44 PM Alvaro Crespo < alvaro.andres.cre...@gmail.com> wrote: > Hi there!

[go-nuts] gomobile: weird dependency on dmitri.shuralyov.com/gpu/mtl

2024-07-11 Thread Alvaro Crespo
Hi there! I'm not an expert go dev but I'm using https://cs.opensource.google/go/x/mobile to build a domain layer for both an Android and an iOS app. First of all, congrats on the good work. The project is amazing. I recently updated the gomobile package version and found out a strange

[go-nuts] Re: branch coverage in text format

2024-07-11 Thread Marcello H
I use this: gitlab.com/fgmarand/gocoverstats to do this: gocoverstats -v -f coverage.txt -percent Op woensdag 10 juli 2024 om 12:06:39 UTC+2 schreef Akash Kumar: > can I get branch coverage in text format? -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Rangefunc in Go 1.23

2024-07-10 Thread Ian Lance Taylor
On Wed, Jul 10, 2024 at 4:17 PM Justin Scheiber wrote: > > I'm trying to establish a mental model for what the compiler does with range > functions in Go 1.23. It looks like the compiler creates a function based on > the for loop body, and calls it by looping over the values passed in. > >

[go-nuts] Rangefunc in Go 1.23

2024-07-10 Thread Justin Scheiber
Howdy, I'm trying to establish a mental model for what the compiler does with range functions in Go 1.23. It looks like the compiler creates a function based on the for loop body, and calls it by looping over the values passed in. Meaning this code: func simpleIter(yield func(v int) bool) {

Re: [go-nuts] go tool cover vs go tool covdata

2024-07-10 Thread Ian Lance Taylor
On Wed, Jul 10, 2024 at 3:07 AM Akash Kumar wrote: > > what is the difference between go tool cover and go tool covdata ? See https://pkg.go/dev/cmd/cover and https://pkg.go.dev/cmd/covdata. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

[go-nuts] go tool cover vs go tool covdata

2024-07-10 Thread Akash Kumar
what is the difference between go tool cover and go tool covdata ? -- 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

[go-nuts] branch coverage in text format

2024-07-10 Thread Akash Kumar
can I get branch coverage in text format? -- 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

Re: [go-nuts] Re: Is []rune(invalidUTF8str) underspecified?

2024-07-09 Thread 'David Anderson' via golang-nuts
On Tue, Jul 9, 2024, at 19:46, Ian Lance Taylor wrote: > On Tue, Jul 9, 2024 at 5:24 PM 'David Anderson' via golang-nuts > wrote: > > > > In practice, as you point out, the original Go implementation does the > > obvious thing and reuses the range iteration behavior. Would it be > > reasonable

Re: [go-nuts] Re: Is []rune(invalidUTF8str) underspecified?

2024-07-09 Thread Ian Lance Taylor
On Tue, Jul 9, 2024 at 5:24 PM 'David Anderson' via golang-nuts wrote: > > In practice, as you point out, the original Go implementation does the > obvious thing and reuses the range iteration behavior. Would it be reasonable > to nail down that `[]rune(foo)` must behave the same as range

Re: [go-nuts] Re: Is []rune(invalidUTF8str) underspecified?

2024-07-09 Thread 'David Anderson' via golang-nuts
On Tue, Jul 9, 2024, at 15:22, peterGo wrote: > > On Tuesday, July 9, 2024 at 3:42:51 PM UTC-4 David Anderson wrote: >> __ >> I've been going over the spec to clarify finer points of how string vs. >> []byte behave, I think there may be an unnecessary degree of freedom that >> could be removed.

[go-nuts] Re: Is []rune(invalidUTF8str) underspecified?

2024-07-09 Thread peterGo
On Tuesday, July 9, 2024 at 3:42:51 PM UTC-4 David Anderson wrote: I've been going over the spec to clarify finer points of how string vs. []byte behave, In https://go.dev/ref/spec#Conversions, `[]rune(str)` is specified as: "Converting a value of a string type to a slice of runes type

[go-nuts] Re: Is []rune(invalidUTF8str) underspecified?

2024-07-09 Thread peterGo
On Tuesday, July 9, 2024 at 3:42:51 PM UTC-4 David Anderson wrote: I've been going over the spec to clarify finer points of how string vs. []byte behave, I think there may be an unnecessary degree of freedom that could be removed. Either that, or I missed a load-bearing statement that

[go-nuts] Is []rune(invalidUTF8str) underspecified?

2024-07-09 Thread 'David Anderson' via golang-nuts
I've been going over the spec to clarify finer points of how string vs. []byte behave, I think there may be an unnecessary degree of freedom that could be removed. Either that, or I missed a load-bearing statement that constrains implementations. In https://go.dev/ref/spec#Conversions,

Re: [go-nuts] cgo: passing unsafe.Pointer of Slice without explicit pinning?

2024-07-08 Thread Ian Lance Taylor
On Mon, Jul 8, 2024 at 4:06 PM Antonio Caceres Cabrera wrote: > > Unless, the C function stores the pointer and it's kept after the call > returns, correct? That's what I mean by calling the function > keep_this_pointer in the second example. In this case, it would be necessary, > I'm

Re: [go-nuts] cgo: passing unsafe.Pointer of Slice without explicit pinning?

2024-07-08 Thread Antonio Caceres Cabrera
Unless, the C function stores the pointer and it's kept after the call returns, correct? That's what I mean by calling the function keep_this_pointer in the second example. In this case, it would be necessary, I'm assuming? Julio On Monday, July 8, 2024 at 11:56:30 PM UTC+2 Ian Lance Taylor

Re: [go-nuts] cgo: passing unsafe.Pointer of Slice without explicit pinning?

2024-07-08 Thread Ian Lance Taylor
On Mon, Jul 8, 2024 at 12:38 PM Antonio Caceres Cabrera wrote: > > Sorry, accidentally hit the wrong response button, so I'm posting it again: > > Thanks for the clarification, Ian. > > Is it also possible to pin memory to local go-arrays? > The docs state > >Go values created by calling new, by

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread 'Robert Engels' via golang-nuts
> The usual way is to factor out any parts that can skew the results > before the benchmark loop and call b.ResetTimer() just before entering > the 'for i := 0; i < b.N; i++ {' loop. That isn’t applicable here. It is the performing of the operation that gets progressively slower. So when

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread Jan Mercl
On Mon, Jul 8, 2024 at 10:36 PM Robert Engels wrote: > Is there anyway to do what I want? The usual way is to factor out any parts that can skew the results before the benchmark loop and call b.ResetTimer() just before entering the 'for i := 0; i < b.N; i++ {' loop. > If not, maybe a useful

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread 'Robert Engels' via golang-nuts
Understood. Is there anyway to do what I want? If not, maybe a useful addition, see https://javadoc.io/doc/org.openjdk.jmh/jmh-core/latest/org/openjdk/jmh/annotations/OperationsPerInvocation.html

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread Jan Mercl
On Mon, Jul 8, 2024 at 10:08 PM 'Robert Engels' via golang-nuts wrote: > Given this code (which I know is not “correct”): Setting b.N in the benchmark code has no specified behavior. The actual behavior at the moment ignores such changes. The algorithm used by the testing package adjusts b.N

Re: [go-nuts] Benchmark "overall" operation

2024-07-08 Thread robert engels
Actually, if I add b.Log("time per op",float64(b.Elapsed().Microseconds())/float64(N_ORDERS*2)) I get a different value than what benchmark reports, so I am certain setting b.N is not correct. > On Jul 8, 2024, at 3:08 PM, 'Robert Engels' via golang-nuts > wrote: > > Given this code

[go-nuts] Benchmark "overall" operation

2024-07-08 Thread 'Robert Engels' via golang-nuts
Given this code (which I know is not “correct”): func BenchmarkOrders(b *testing.B) { var ob = orderBook{} var inst = Equity{} var ex = testExchangeClient{} const N_ORDERS = 100 b.ResetTimer() b.N = N_ORDERS for

Re: [go-nuts] cgo: passing unsafe.Pointer of Slice without explicit pinning?

2024-07-08 Thread Antonio Caceres Cabrera
Sorry, accidentally hit the wrong response button, so I'm posting it again: Thanks for the clarification, Ian. Is it also possible to pin memory to local go-arrays? The docs state >Go values created by calling new, by taking the address of a composite literal, or by taking the address of a

Re: [go-nuts] Re: Go 1.21 / FIPS

2024-07-08 Thread 'Davis Goodin' via golang-nuts
Yes, these questions are specific to the Microsoft fork of Go (and to varying degrees, could apply to other FIPS-focused forks of Go). To repeat from earlier, in case it helps anyone seeing this thread later: > The GOEXPERIMENT=systemcrypto is a feature of the Microsoft fork of Go, not

Re: [go-nuts] cgo: passing unsafe.Pointer of Slice without explicit pinning?

2024-07-07 Thread Ian Lance Taylor
On Sun, Jul 7, 2024 at 6:17 AM Antonio Caceres Cabrera wrote: > > I'm trying to use cgo for a C library, specifically a function which takes a > void pointer to a buffer, and I'm trying to pass a Go-Slice as this buffer. > > ``` > func Write(buf []byte) (int, error) { > // var pin

[go-nuts] cgo: passing unsafe.Pointer of Slice without explicit pinning?

2024-07-07 Thread Antonio Caceres Cabrera
Hi Gophers, I'm trying to use cgo for a C library, specifically a function which takes a void pointer to a buffer, and I'm trying to pass a Go-Slice as this buffer. ``` func Write(buf []byte) (int, error) { // var pin rumtime.Pinner // pin.Pin([0]) // defer pin.Unpin() // is

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-07 Thread 'Brian Candler' via golang-nuts
The question seems to be: "I know this is a data race, but isn't this a *safe* data race?" To which the answer should be: "There are no safe data races". https://docs.google.com/document/d/1WAT22FtFdMt43i3O8YrnlQTNTzZ3IoJBtu3P2DNRytg/ # was previously:

Re: [go-nuts] Can't range over iter.Seq in text/template (go 1.22/dev)

2024-07-07 Thread Rory Campbell-Lange
On 06/07/24, Ian Lance Taylor (i...@golang.org) wrote: > On Sat, Jul 6, 2024 at 2:21 PM Rory Campbell-Lange > wrote: > > > > I don't seem to be able to range over an iter.Seq in a template. ... > > ...is an iter.Seq or iter.Seq2 not intended to be added there? > > Yes, this is

Re: [go-nuts] Can't range over iter.Seq in text/template (go 1.22/dev)

2024-07-06 Thread Ian Lance Taylor
On Sat, Jul 6, 2024 at 2:21 PM Rory Campbell-Lange wrote: > > I don't seem to be able to range over an iter.Seq in a template. ... > ...is an iter.Seq or iter.Seq2 not intended to be added there? Yes, this is https://go.dev/issue/66107. Ian -- You received this message because you are

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread burak serdar
The way I read the section about programs with memory races (https://go.dev/ref/mem#restrictions), that program should always print 1. "A read r of a memory location x holding a value that is not larger than a machine word must observe some write w such that r does not happen before w and there

[go-nuts] Can't range over iter.Seq in text/template (go 1.22/dev)

2024-07-06 Thread Rory Campbell-Lange
I don't seem to be able to range over an iter.Seq in a template. error: executing "test" at <.>: range can't iterate over 0x5103c0 resulter := func(yield func(int) bool) { for _, v := range []int{1, 2, 3} { if !yield(v) {

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Ian Lance Taylor
On Sat, Jul 6, 2024 at 7:34 AM 'qiu laidongfeng2' via golang-nuts wrote: > > I know not to write code with data races? > The problem is that I find that this code always outputs 1 on the amd64 > machine, > I am not sure what effect this data competition has on the execution result, > whether it

Re: [go-nuts] Re: 'go run hello.go' taking ~30 seconds on windows

2024-07-06 Thread Laurent Caumont
go compiler is not signed. It might be interesting to see if signing the executable has an impact on the antivirus scan. Le mercredi 20 mars 2024 à 20:23:46 UTC+1, Larry Clapp a écrit : > I found this webpage from MS which talks about configuring Windows > Defender. > > >

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Robert Engels
I corrected myself. On Jul 6, 2024, at 10:34 AM, peterGo wrote:On Saturday, July 6, 2024 at 11:21:46 AM UTC-4 Robert Engels wrote:That is not a data race. The wait group is a synchronization barrier. ==WARNING: DATA RACEWrite at 0x00c14158 by goroutine 8:  main.main.func1()   

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread peterGo
On Saturday, July 6, 2024 at 11:21:46 AM UTC-4 Robert Engels wrote: That is not a data race. The wait group is a synchronization barrier. == WARNING: DATA RACE Write at 0x00c14158 by goroutine 8: main.main.func1() /home/peter/racer.go:12 +0x84 Previous write at

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Jan Mercl
On Sat, Jul 6, 2024 at 5:21 PM Robert Engels wrote: > That is not a data race. The wait group is a synchronization barrier. Multiple concurrent, uncoordinated writers are a perfect data race. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Robert Engels
Sorry and the outer loop is the only reader. It probably reports it as a race though since there are multiple writers - but they all write the same value. Technically still a data race depending on if the word splits when writing. On Jul 6, 2024, at 10:20 AM, Robert Engels wrote:That is not a

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Robert Engels
That is not a data race. The wait group is a synchronization barrier. On Jul 6, 2024, at 9:34 AM, 'qiu laidongfeng2' via golang-nuts wrote:I know not to write code with data races?The problem is that I find that this code always outputs 1 on the amd64 machine,I am not sure what effect this data

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread 'qiu laidongfeng2' via golang-nuts
I know not to write code with data races? The problem is that I find that this code always outputs 1 on the amd64 machine, I am not sure what effect this data competition has on the execution result, whether it is an inevitable result of the amd64 machine to always output 1 or I am lucky to

Re: [go-nuts] errors.Join to return a single error if possible

2024-07-06 Thread Ian Lance Taylor
On Sat, Jul 6, 2024 at 7:04 AM Andrei Rusakov wrote: > > So, what do you think it makes sense for the function to return a wrapped > error even if it contains only one error? Wouldn't it be more rational in > such cases for Join to return that single error? Perhaps that would have made sense,

Re: [go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread Ian Lance Taylor
On Sat, Jul 6, 2024 at 7:04 AM 'qiu laidongfeng2' via golang-nuts wrote: > > Does data race in this program affect execution results? > In amd64, it always output1. If you want to write code like this, use the sync/atomic package. Don't write code with data races. Ian -- You received this

[go-nuts] Does data race with only multiple goroutine parallel i=1 have an impact on the execution results?

2024-07-06 Thread 'qiu laidongfeng2' via golang-nuts
Does data race in this program affect execution results? In amd64, it always output1. ```go package main import "sync" func main() { i := 0 var wg sync.WaitGroup for range 100 { wg.Add(1) go func() { defer wg.Done() i = 1 }() } wg.Wait() println(i) } ``` -- You received this message

[go-nuts] errors.Join to return a single error if possible

2024-07-06 Thread Andrei Rusakov
Hey gophers, I would like to know your opinion on the following topic. In my experience, the most popular case for errors.Join is to handle deferred potential errors such as closing os.File, sql.Rows or http.Response.Body. Might be a bit of a contrived example,

Re: [go-nuts] Re: Go 1.21 / FIPS

2024-07-05 Thread Kurtis Rader
GOFIPS doesn't appear anywhere in the official Google Go source, AFAICT. And the document at https://github.com/golang/go/blob/release-branch.go1.21/src/crypto/internal/boring/README.md is reasonably clear that simply setting GOEXPERIMENT=boringcrypto is all that is needed using the official Go

[go-nuts] Re: Go 1.21 / FIPS

2024-07-05 Thread Damien A
I am using the Microsoft version of Go lang as that is what my work instructed me to use. My only task was to build Grafana using FIPS (or as close to it as i can get). As i mentioned in Microsoft Go 1.20.5 i was able to build using GOEXPERIMENT=opensslcrypto, and GOFIPS=1, but it appears now

[go-nuts] Re: APIs in go for CPU and memory usage

2024-07-05 Thread Anurag Rao
You can use gopsutil On Sunday, March 5, 2017 at 10:55:29 AM UTC+5:30 dharma...@gmail.com wrote: > On linux, you can read in /proc/stat for cpu specific and aggregated data. > Other info in /proc/stat can get you info on each running process. Google > for

[go-nuts] Re: Go 1.21 / FIPS

2024-07-05 Thread 'dagood' via golang-nuts
Hi Michael, Ian's clarification of "support" matches what I meant. In fact, the FIPS features in microsoft/go rely on many of the boringcrypto code changes. We've found it to be a good foundation for our implementation despite not being supported. For background information about FIPS, look

Re: [go-nuts] Re: Go 1.21 / FIPS

2024-07-04 Thread Ian Lance Taylor
On Thu, Jul 4, 2024, 4:47 AM Michael Oguidan wrote: > Hi Dagood, > Please can you tell me what FIPS's for? And why we can't use it outside > Google. > You can use GOEXPERIMENT=boringcrypto, as described in the README. However, there is no promise that the Go team will fix any problems you

[go-nuts] Re: Go 1.21 / FIPS

2024-07-04 Thread Michael Oguidan
Hi Dagood, Please can you tell me what FIPS's for? And why we can't use it outside Google. On Thursday, July 4, 2024 at 1:45:37 AM UTC dagood wrote: > Hi Devin, > > The FIPS functionality in Go (which, to be clear, is not supported for use > outside of Google) is documented here: >

[go-nuts] Re: Go 1.21 / FIPS

2024-07-03 Thread 'dagood' via golang-nuts
Hi Devin, The FIPS functionality in Go (which, to be clear, is not supported for use outside of Google) is documented here: go/src/crypto/internal/boring/README.md at release-branch.go1.21 · golang/go (github.com)

[go-nuts] Re: Go 1.21 / FIPS

2024-07-03 Thread Michael Oguidan
"wire: err: exit status 2: stderr: panic: FIPS mode requested (environment variable GOFIPS=1) but no supported crypto backend is enabled" The problem could come from the fact that no crypto backend is enabled. So try to solve that first.. On Tuesday, July 2, 2024 at 11:06:25 PM UTC Damien A

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

2024-07-03 Thread kristian.koehler via golang-nuts
Thanks! Thanks. The original URL also works now.  I'll probably change my script to your version, it seems to be more "up to date". Kristian Am Mittwoch, dem 03.07.2024 um 12:42 + schrieb Steve Mynott: > I'm using > > curl -L -s "https://golang.org/dl/?mode=json; | jq -r '.[0].version' >

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

2024-07-03 Thread Hugh Myrie
Look at the sample text file and tell why the special characters differ. When I open the file in VSCode, the special characters in the first sample are highlighted. Could you explain why? On Wednesday, July 3, 2024 at 10:42:07 AM UTC-4 Hugh Myrie wrote: > Yes, PeterGo got it correctly. That

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

2024-07-03 Thread Hugh Myrie
Yes, PeterGo got it correctly. That is what I expect to see so I can post it to an API. On Tuesday, July 2, 2024 at 11:28:39 PM UTC-4 peterGo wrote: > Ian, > > Hugh Myrie might be expecting to see something like this: > > https://go.dev/play/p/7TlD5R1C0oX > > Peter > > On Tuesday, July 2, 2024

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

2024-07-03 Thread Steve Mynott
I'm using curl -L -s "https://golang.org/dl/?mode=json; | jq -r '.[0].version' which returns go1.22.5 Cheers Steve On Wed, 3 Jul 2024 at 12:26, kristian.koehler via golang-nuts wrote: > > Hi, > > I have a script that loads the current Go version from the website and > updates my environment.

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

2024-07-03 Thread kristian.koehler via golang-nuts
Hi, I have a script that loads the current Go version from the website and updates my environment. Unfortunately it still returns the old version: https://go.dev/VERSION?m=text --- 8< --- go1.22.4 time 2024-05-30T19:26:07Z --- 8< --- Is a website rebuild/restart necessary? Thanks, Kristian

Re: [go-nuts] What happened to sep in errorrs.join

2024-07-03 Thread Marian Ciobanu
Unless I'm missing something, these are equivalent: errors.Join(err1, err2) fmt.Errorf("%w\n%w", err1, err2) So you can use the second form to achieve something similar to whatever separator you want to use. On Thursday, August 10, 2023 at 4:35:16 AM UTC+3 jal...@gmail.com wrote: > this

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

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

2024-07-01 Thread Ian Lance Taylor
On Mon, Jul 1, 2024 at 12:04 PM 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

[go-nuts] Re: Advancing the container/set design?

2024-07-01 Thread twp...@gmail.com
+1 on this. At the moment, every module that needs a set implementation ends up creating its own, either using map[T]struct{} or map[T]bool. Having a set implementation in the standard library would significantly increase operability between modules, even if the implementation is trivial.

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

2024-07-01 Thread Hugh Myrie
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 \x03). I am sending the data from the client as text/plain. I

[go-nuts] Advancing the container/set design?

2024-07-01 Thread Frederik Zipp
Some time ago, Ian started a discussion about a potential proposal for a container/set package: https://github.com/golang/go/discussions/47331 The main point of uncertainty was iterating over elements. Now that iteration is solved in Go 1.23, is it perhaps time to advance this design and turn

Re: [go-nuts] is stop the world and restart the world overhead expensive?

2024-07-01 Thread Ian Lance Taylor
On Mon, Jul 1, 2024 at 5:45 AM 杨杰 wrote: > > i implement an goroutine profile which use frame pointer to get traceback. > > it need stop and restart the world with 100hz. > > is this operation expensive? Yes. Since the concern is profiling, I'll note that it will also significantly affect the

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

2024-07-01 Thread Timur Sharapov
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 pass to the method, if the method modifies the value the

[go-nuts] is stop the world and restart the world overhead expensive?

2024-07-01 Thread 杨杰
i implement an goroutine profile which use frame pointer to get traceback. it need stop and restart the world with 100hz. is this operation expensive? see https://github.com/felixge/fgprof/issues/31 -- You received this message because you are subscribed to the Google Groups "golang-nuts"

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

2024-06-30 Thread Arkadiusz Drabczyk
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 platform native capabilities...  It is as described in the second part of this answer

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

2024-06-29 Thread Victor Manuel Giordano
Thank you all for the feedback. It is appreciated. - *So it is not possible via the golang platform native capabilities... * - The Visual Studio Code (IDE) offers a good feature building on top of the -run flag - It parses the file to test, recovers all the test function names of

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

2024-06-29 Thread Marcello H
You can look at how your IDE would do it, or, you can put a build tag in and only test that build tag Op zaterdag 29 juni 2024 om 03:37:28 UTC+2 schreef Kurtis Rader: > On Fri, Jun 28, 2024 at 3:25 PM Victor Manuel “Vitu” Giordano < > vituc...@gmail.com> wrote: > >> I struggle with performing

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

2024-06-28 Thread Kurtis Rader
On Fri, Jun 28, 2024 at 3:25 PM Victor Manuel “Vitu” Giordano < vitucho3...@gmail.com> wrote: > I struggle with performing all the tests written in a file that requires > symbols defined on other files of the same package. > > For example > $ go test practice_resource_test.go > #

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

2024-06-28 Thread Ian Lance Taylor
On Fri, Jun 28, 2024 at 3:25 PM Victor Manuel “Vitu” Giordano wrote: > > I struggle with performing all the tests written in a file that requires > symbols defined on other files of the same package. > > For example > $ go test practice_resource_test.go > # command-line-arguments

[go-nuts] Testing specific file in a package

2024-06-28 Thread Victor Manuel “Vitu” Giordano
Hi guys! How you are doing? I struggle with performing all the tests written in a file that requires symbols defined on other files of the same package. For example $ go test practice_resource_test.go # command-line-arguments [command-line-arguments.test] ./practice_resource_test.go:11:12:

[go-nuts] Go AWS SDK v1 entering maintenance mode

2024-06-28 Thread Chris Vitale
Support ends in a year. https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025/ -- 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,

Re: [go-nuts] go clean -h isn't helpful

2024-06-28 Thread qrta...@gmail.com
I tried a patch as my first contribution :) https://github.com/golang/go/issues/68242 Laszlo Ian Lance Taylor a következőt írta (2024. június 23., vasárnap, 4:01:31 UTC+2): > On Sat, Jun 22, 2024, 6:21 PM Will Faught wrote: > >> I see. That doesn't seem very useful to me, so I won't be making

[go-nuts] [security] Go 1.22.5 and Go 1.21.12 pre-announcement

2024-06-27 Thread announce
Hello gophers, We plan to issue Go 1.22.5 and Go 1.21.12 during US business hours on Tuesday, July 2. These minor releases include PRIVATE security fixes to the standard library, covering the following CVE: - CVE-2024-24791 Following our security policy, this is the pre-announcement of

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-26 Thread Ian Lance Taylor
On Tue, Jun 25, 2024 at 9:37 PM 'Axel Wagner' via golang-nuts wrote: > > you might be interested to learn that Ian has filed a CL adding an FAQ entry. Now committed at https://go.dev/doc/faq#zero_size_types . Ian -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] why we still need lock file ?

2024-06-26 Thread ben...@gmail.com
It's a pretty good bet that Akash is asking about go.sum. Akash, the go.sum is not actually a "lock file" (like many other languages' package managers have). Just go.mod is enough to determine the exact versions of all the modules, as you indicate. What go.sum contains are cryptographic hashes

[go-nuts] Re: Performance of unique package

2024-06-26 Thread Juliusz Chroboczek
After fixing the bugs pointed out by Michael (I'm incompetent), here are the new results: Uninterned-8120ms ą18% Map-8 140ms ą 2% LockedMap-8 139ms ą 2% LockedParellel-8146ms ą 2% SyncMap-8 253ms ą 4% SyncMapParallel-8 109ms ą

Re: [go-nuts] why we still need lock file ?

2024-06-26 Thread Ian Lance Taylor
On Tue, Jun 25, 2024 at 11:58 PM Akash Kumar wrote: > > As go is using minimum version selection strategy for creating reproducible > build list, so why we still need a lock file ? also is there plans to > deprecate lock file in future ? What lock file are you talking about? Ian -- You

  1   2   3   4   5   6   7   8   9   10   >