Re: [go-nuts] cmd/trace: Indirect reporting of OS Latency?

2022-02-11 Thread robert engels
I suggest you use the linux scheduler tracing facilities, e.g. perf shed to diagnose (see https://www.brendangregg.com/perf.html#SchedulerAnalysis ) But you may have to also do this outside the VM - to schedule trace the VM. In general,

[go-nuts] cmd/trace: Indirect reporting of OS Latency?

2022-02-11 Thread Rich Moyse
*TLDR* I’d be grateful if someone could either confirm or dismiss the effect of OS, go runtime, and/or Hypervisor latency on the output of a goroutine trace. The trace report displays empty gaps of 3-14ms where expected periodic goroutines should execute, as there’s a goroutine triggered by

[go-nuts] Re: Getting "$GOPATH/go.mod exists but should not" when running build in a Docker image

2022-02-11 Thread Sean Liao
The `golang` container image sets the GOPATH directory to /go and the working directory to /go too. Following GOPATH layout, source code is expected to be in directories under /go/src. `/go/bin` is where binaries are installed by default, and `/go/pkg` include things like the module cache. With

[go-nuts] Re: Why you can name variable or type parameter int or uint8???

2022-02-11 Thread Jason Phillips
In C and C++[1][2] "int" and "float" are reserved keywords and thus can't be used as identifiers. In Go[3], "int" and "float64" are "predeclared identifiers"[4] and can be redefined, just like any other identifier. [1] - https://en.cppreference.com/w/c/keyword [2] -

[go-nuts] Getting "$GOPATH/go.mod exists but should not" when running build in a Docker image

2022-02-11 Thread David Karr
I had earlier written a note about troubles refactoring my project to have a "src" directory, but I've backed off on that for now. I see that the main problem I saw with that hasn't changed when backing out those changes. It appears that running this build inside a docker image seems to be

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread Jan Mercl
On Fri, Feb 11, 2022 at 5:06 PM 'Axel Wagner' via golang-nuts wrote: > FYI I went ahead and filed https://github.com/golang/go/issues/51145 I must be missing something because I still don't understand what the problem is. The syntax `type A[B]C` can be reduced both in Go1.17 and Go1.18 in only

[go-nuts] Re: How to handle CONNECT in HTTP2 to build a tunnel

2022-02-11 Thread Koala Guo
hi, I meet the same issue. I dont know whether you has resloved the issue if you resloved this,can you give some tips? 在2016年4月15日星期五 UTC+8 02:30:48 写道: > Hi~ I try to implement a h2 tunnel, but meet some problem.. > > base on http://httpwg.org/specs/rfc7540.html#CONNECT and >

Re: [go-nuts] Changing channel from unbuffered to buffered prevents goroutine from running

2022-02-11 Thread Dean Schulze
The loop printing 0s was caused by having the defer close() statements outside the goroutine. The channels were being closed before the goroutine ran and the gorouting was continuously reading from a closed channel. Hence the 0s. The defer close() statements have to be inside the goroutine.

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread 'Axel Wagner' via golang-nuts
FYI I went ahead and filed https://github.com/golang/go/issues/51145 On Fri, Feb 11, 2022 at 4:57 PM Axel Wagner wrote: > > > On Fri, Feb 11, 2022 at 3:14 PM Kamil Ziemian > wrote: > >> "> type someDifferentInt[float64] int >> I can't see why the parser can't see that this should (if anything)

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread 'Axel Wagner' via golang-nuts
On Fri, Feb 11, 2022 at 3:14 PM Kamil Ziemian wrote: > "> type someDifferentInt[float64] int > I can't see why the parser can't see that this should (if anything) be > interpreted as an array type declaration. To me, this seems like a > regression. I'd suggest maybe filing an issue." > > I think

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread 'Axel Wagner' via golang-nuts
On Fri, Feb 11, 2022 at 2:48 PM Kamil Ziemian wrote: > Somewhere on GitHub there is a discussion about unused type of arguments > in the function. I think they agree that with benefits of hindsight you > should be force to write func f(_ int) ... for any unused argument, that is > need for

Re: [go-nuts] Changing channel from unbuffered to buffered prevents goroutine from running

2022-02-11 Thread Dean Schulze
Correction to my first response: Putting the wg.Add() inside the goroutine works as long as the goroutine runs. But the program could exit before the goroutine starts. To avoid this the wg.Add() should be outside the goroutine, as you said. The big problem with this code is that the defer

Re: [go-nuts] Changing channel from unbuffered to buffered prevents goroutine from running

2022-02-11 Thread Dean Schulze
The WaitGroup works if wg.Add() is called within the goroutine. The only purpose for the WaitGroup is to keep main from exiting before the goroutine has completed. Moving wg.Add() outside of the goroutine has no effect if the channel is unbuffered. But if I make the channel buffered and move

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread Kamil Ziemian
I'm seriously lost here. Code below works in both Go 1.17 and Go 1.18beta2 > package main > > import "fmt" > > type someInterface[3] interface { > SomeMethod() > } > > func main() { > var varSI someInterface > > fmt.Printf("varSI value: %v\n", varSI) >

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread Kamil Ziemian
"Why is it a sin? It's a perfectly normal type definition. Quite common, because useful for attaching methods to a type. One cannotattach a method to type [3]int." To write it with such white spaces > type typeName[3] int looks like sinful thing to me. It should be > type typeName [3]int No

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread Jan Mercl
On Fri, Feb 11, 2022 at 3:13 PM Kamil Ziemian wrote: > "> type someDifferentInt[float64] int > I can't see why the parser can't see that this should (if anything) be > interpreted as an array type declaration. To me, this seems like a > regression. I'd suggest maybe filing an issue." > > I

Re: [go-nuts] Re: gollvm compilation issue

2022-02-11 Thread Zhen Huang
Yes, I can build now. Thank you for the fix. On Wed, Feb 9, 2022 at 4:52 PM Than McIntosh wrote: > OK, I checked in another CL to resolve this new issue. Give it a try again > please and let me know if you are able to build. > > Thanks, Than > > > On Wed, Feb 9, 2022 at 2:35 PM Than McIntosh

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread Kamil Ziemian
"> type someDifferentInt[float64] int I can't see why the parser can't see that this should (if anything) be interpreted as an array type declaration. To me, this seems like a regression. I'd suggest maybe filing an issue." I think I know the reason. You can write > type someArrayWithThreeInt

Re: [go-nuts] Does anyone gets automatic response from 944677...@qq.com?

2022-02-11 Thread Kamil Ziemian
Bad that this is not only my problem. Did anyone try to write to person that set up this auto replay? piątek, 11 lutego 2022 o 14:56:10 UTC+1 ren...@ix.netcom.com napisał(a): > Same issue. Some one set up auto reply to message threads. > > On Feb 11, 2022, at 6:36 AM, Kamil Ziemian wrote: > >

Re: [go-nuts] Does anyone gets automatic response from 944677...@qq.com?

2022-02-11 Thread Robert Engels
Same issue. Some one set up auto reply to message threads. > On Feb 11, 2022, at 6:36 AM, Kamil Ziemian wrote: > >  > Hello, > > I try to don't care about this response, but I see them one time to much. > After most if not all my post here, I get email from 944677...@qq.com with > title >

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread Kamil Ziemian
Axel I agree that "But there is at least some potential benefit to allowing it.". But, by my humble understanding, true question is "Would Go still feel likes Go after this?". This question is one of the reasons why generics was so long, decade or even more, in the making. Somewhere on GitHub

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread Kamil Ziemian
Thank you Jan Marcel. I see now that I wasn't precise enough. I understand that '[' and ']' are just tokens, even I have only intuitive understanding of concept of token. My problem is that as Ian Lance Taylor and other people said many times: adding generics will make Go more complicated. My

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread 'Axel Wagner' via golang-nuts
On Fri, Feb 11, 2022 at 12:51 PM Kamil Ziemian wrote: > I'm now trying to play with compilers with this construction. > > type someDifferentInt[float64] int > In Go 1.17 I get this complain > > invalid array bound float64 > > type float64 is not an expression > while in Go 1.18beta2 I get > >

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread 'Axel Wagner' via golang-nuts
On Fri, Feb 11, 2022 at 12:51 PM Kamil Ziemian wrote: > Can someone explain me, why compiler can't throw an error when it find > unused type parameter? I like that in Go unused variable, or import, is > compile time error and I would appreciate the same behavior with unused > type parameters. >

[go-nuts] Does anyone gets automatic response from 944677...@qq.com?

2022-02-11 Thread Kamil Ziemian
Hello, I try to don't care about this response, but I see them one time to much. After most if not all my post here, I get email from 944677...@qq.com with title "自动回复: [go-nuts]: title of the thread" and content "这是来自QQ邮箱的假期自动回复邮件。 您好,我暂时无法亲自回复您的邮件。我将在最短的时间内尽快给您回复。谢谢。" Gmail translate it to

Re: [go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread Jan Mercl
On Fri, Feb 11, 2022 at 12:50 PM Kamil Ziemian wrote: > I need to go for a while, I will go back with more questions about what you > can get when using "[]" in Go. The '[' and ']' is just a pair of tokens with no meaning attached to it per se. Context is everything. So square brackets in one

[go-nuts] Strange cases of type definitions that use "[]", Go 1.17 and 1.18beta2

2022-02-11 Thread Kamil Ziemian
Hello, I should mention that I still don't read Go Language Specification (https://go.dev/ref/spec), due to my decision to first study Unicode and UTF-8, before reading it. It maybe strange thing to do, but I just how I need to deal with Unicode and UTF-8. Regardless of that I quickly check

Re: [go-nuts] Re: DataRace with slice, should i fix it or ignore it?

2022-02-11 Thread 'Dmitry Vyukov' via golang-nuts
On Fri, 11 Feb 2022 at 09:54, wrote: > > If the updated "go/benign-race link" is a canonical url, could you > please share the prefix as well? > ( I tried http://go.dev/go/benign-race and some other variations, but > these don't work. Archive.org link is working. ) Oh, sorry didn't realize this

Re: [go-nuts] Re: DataRace with slice, should i fix it or ignore it?

2022-02-11 Thread fgergo
If the updated "go/benign-race link" is a canonical url, could you please share the prefix as well? ( I tried http://go.dev/go/benign-race and some other variations, but these don't work. Archive.org link is working. ) On 2/10/22, 'Dmitry Vyukov' via golang-nuts wrote: > I've recovered it and