[go-nuts] about generic?

2021-03-18 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/noder/noder.go#L80 in my opion, after the call of check2, the generic type and generic func has convert to instantiation type or func, so the after this func the compiler works similiar to no generic compiler. am i right? --

Re: [go-nuts] pkg.go.dev Documentation section empty

2021-03-18 Thread Tong Sun
( Sorry Alex, didn't meant to sent to you personally ) Oh, thanks. Just realized that the Documentation section is only for modules, right? I.e., mine is an executable, and this is the first time I'm looking at my docs on pkg.go.dev, in which my long readme is "missing", the whole page is almost

Re: [go-nuts] Some questions about the memory allocation strategy of channel

2021-03-18 Thread Paul Zhang
For this piece of code: case elem.ptrdata == 0: // Elements do not contain pointers. // Allocate hchan and buf in one call. c = (*hchan)(mallocgc(hchanSize+mem, nil, true)) c.buf = add(unsafe.Pointer(c), hchanSize) default: // Elements contain pointers. c = new(hchan) c.buf =

Re: [go-nuts] Re: build world question

2021-03-18 Thread Hotei
Jan, To clarify a bit, "world" used to be everything under $GOPATH/src. Since gophers can expect at some point to see $GOPATH go away the directory I now refer to as "world" is just a local/private version of my github.com/hotei repository with about 250 or so subdirs that represent

Re: [go-nuts] pkg.go.dev Documentation section empty

2021-03-18 Thread 'Axel Wagner' via golang-nuts
Hi, https://go.dev/about#adding-a-package gives general information about adding a module. One of the most common reasons why documentation might not show up is that your module doesn't contain an open source license that pkg.go.dev recognizes. https://pkg.go.dev/license-policy contains some

[go-nuts] pkg.go.dev Documentation section empty

2021-03-18 Thread Tong Sun
The "Documentation" section is empty for my package on pkg.go.dev. Where can I read how to fix it? Thanks -- 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

Re: [go-nuts] Trying to use a tool in my build (a friction log)

2021-03-18 Thread 'Jay Conrod' via golang-nuts
Hey Tim, thanks for writing this up. These kinds of reports are helpful. I'll try to respond to a few problems individually. *1. Command installation with "go install"* There are basically two ways to do this, depending on whether you want to install the command within the context of your

[go-nuts] Re: No generic, part -2

2021-03-18 Thread wilk
On 18-03-2021, Tyler Compton wrote: > I think we all want to stick our noses in this thread. I'm going to stick > my nose in it too :) > > Space, I don't think you'll ever be happy as a result of this discussion, > no matter what evidence or arguments others provide you. I think the fact > is

Re: [go-nuts] Help with contributing to the Golang

2021-03-18 Thread Ian Lance Taylor
On Thu, Mar 18, 2021 at 9:55 AM Kirill Prokopovich wrote: > > Hello everyone! > Can somebody help with some advice about starting contributing in Golang? > > I've already read https://golang.org/doc/contribute.html and tried to find > some issues from

Re: [go-nuts] go build error in darwin: duplicate symbol

2021-03-18 Thread Ian Lance Taylor
On Thu, Mar 18, 2021 at 9:55 AM Max Xu wrote: > > I'm running into a weird bug: > > Failed with command: > GOOS=darwin go build > > Bug success with: > GOOS=linux go build > > The failed Message: > > /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running clang failed: > exit status 1 >

[go-nuts] Re: %v for []string{} and []string{""}

2021-03-18 Thread 'Kevin Chowski' via golang-nuts
The "%#v" print verb is intended to be used for unambiguous printing of a type, but that means it will have a prefix of `[]string` in order to ensure the type is unambiguous. I personally use %q a lot any time I know I have a string (or set of strings) which might be ambiguous in some way, but

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Tyler Compton
I think we all want to stick our noses in this thread. I'm going to stick my nose in it too :) Space, I don't think you'll ever be happy as a result of this discussion, no matter what evidence or arguments others provide you. I think the fact is that you were burned by the outcome of the generics

[go-nuts] Trying to use a tool in my build (a friction log)

2021-03-18 Thread 'Tim Hockin' via golang-nuts
First: go version go1.16 linux/amd64 In one of my side-projects, I build a container image. It turns out to be useful to people, but I got a request to put the license files for all code used in the binary into the container. Lawyers, what can you do? So these people sent me a PR to gather the

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Ian Lance Taylor
On Thu, Mar 18, 2021 at 5:11 AM Space A. wrote: > > > What kind of proof would you find to be acceptable? Can you give an > example of something that I could say that you would consider to be a > good answer to that question? Thanks. > > Ian, seriously. ANY evidence please, which you think

Re: [go-nuts] Some questions about the memory allocation strategy of channel

2021-03-18 Thread Ian Lance Taylor
On Thu, Mar 18, 2021 at 9:55 AM Paul Zhang wrote: > > I was reading the source code of makechan(), and these questions confused me. > I would appreciate it if someone could help me. > > Q1. What does Elements do not contain pointers. mean? Does that means that > the type of channel is not a

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread Ian Lance Taylor
On Thu, Mar 18, 2021 at 11:37 AM Space A. wrote: [ omitted ] This message does not follow the Go Community Code of Conduct (https://golang.org/conduct). On this mailing list we ask everybody to follow those guidelines. Please respect that. Thank you. Ian -- You received this message

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread Space A.
Sorry but if you don't want to be targeted, resign from your manager's position. Less responsibility, less spotlight, and still good compensation package from Google. чт, 18 мар. 2021 г. в 20:45, Andrew Bonventre : > This conversation has not been adhering to Go’s values >

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread Space A.
> that racists are not welcome here You probably mean white racists? But black are welcomed. I also very like this cite: “It should be noted that no ethically -trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Robert Engels
I will point out again - there is a big difference between reading/writing generic “usage” code, and generic “implementation” code. The vast majority of developers will only need to do the former - and modern IDEs make this somewhat trivial. > On Mar 18, 2021, at 12:57 PM, 'Axel Wagner' via

Re: [go-nuts] No generic, part -2

2021-03-18 Thread 'Axel Wagner' via golang-nuts
On Thu, Mar 18, 2021 at 5:59 PM Kent Sandvik wrote: > So if I understand this correctly, you don't want to learn a new syntax in > the language? > That is not what I tried to say :) I'm leaning towards being in favor of adding generics. I was trying to say that I think it's unavoidable that Go

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread Andrew Bonventre
This conversation has not been adhering to Go’s values of being respectful and charitable with each other. I’d like to request it come to an end. Additionally, please do not make assumptions about specific members of the community and their role in things. I was

Re: [go-nuts] No generic, part -2

2021-03-18 Thread David Skinner
I am very much pro generics, having used them with Go for many years. I have only found them to be occasionally useful (10%), but on those occasions, it saves me time, improves reliability, and enhances the ability to maintain the code. Having a background in MASM, TASM, Forth, Lisp, C++ leaves

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread 'Thomas Bushnell BSG' via golang-nuts
On Wed, Mar 17, 2021 at 8:33 AM mortdeus wrote: > Are you absolutely SURE you want to keep up the "your not welcome here" > sign to people who literally find the message to be dangerous to the very > people they claim to want to protect. Do we really want to encourage an > opensource culture,

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread 'Thomas Bushnell BSG' via golang-nuts
On Wed, Mar 17, 2021 at 8:22 AM mortdeus wrote: > Why do black lives matter more than Syrian lives? Nobody said they do. The banner does not make any comparisons. Thomas -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread 'Thomas Bushnell BSG' via golang-nuts
On Wed, Mar 17, 2021 at 8:22 AM mortdeus wrote: > The problem is that this inspires a political discussion that obviously > should happen with your city council or your therapist. Not with gophers. > If you don't believe the political discussion should happen, then I would recommend you resist

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Kent Sandvik
So if I understand this correctly, you don't want to learn a new syntax in the language? On Thu, Mar 18, 2021 at 9:37 AM 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I also think there is definitely credence to the idea that we read more > code than we write (after all,

[go-nuts] Sending 100 Continue with unknown Content-Length

2021-03-18 Thread Marks Polakovs
Hi all, I'm writing a server that can receive streaming audio (using the Icecast protocol) over HTTP. The gist of the protocol is: 1. Client sends a PUT with, among others, a "Expect: 100-continue" 2. Server validates the request and replies with "HTTP/1.1 100 Continue" 3. Client

[go-nuts] Help with contributing to the Golang

2021-03-18 Thread Kirill Prokopovich
Hello everyone! Can somebody help with some advice about starting contributing in Golang? I've already read https://golang.org/doc/contribute.html and tried to find some issues from https://github.com/golang/go/labels/help%20wanted , but it's not so obvious how to choose a free issue but I'm

[go-nuts] Some questions about the memory allocation strategy of channel

2021-03-18 Thread Paul Zhang
I was reading the source code of makechan(), and these questions confused me. I would appreciate it if someone could help me. Q1. What does Elements do not contain pointers. mean? Does that means that the type of channel is not a pointer type (like chan int and chan *int)? Q2. Why does the

[go-nuts] go build error in darwin: duplicate symbol

2021-03-18 Thread Max Xu
Hi all, I'm running into a weird bug: Failed with command: GOOS=darwin go build Bug success with: GOOS=linux go build The failed Message: /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1 duplicate symbol '_readdrivestat' in:

Re: [go-nuts] No generic, part -2

2021-03-18 Thread 'Axel Wagner' via golang-nuts
I also think there is definitely credence to the idea that we read more code than we write (after all, a lot of Go's design is based on that idea too). So I definitely agree that most Go programmers will find it hard to avoid generics, even if they want. Usage of the language is very likely to

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Robert Engels
I think the most plausible events are that various collections apis make it into the api as a “replacement” for the non type safe interface based ones. > On Mar 18, 2021, at 11:20 AM, Kent Sandvik wrote: > >  > I'm very dumb, but if you don't want to use generics or think they are bad > for

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Kent Sandvik
I'm very dumb, but if you don't want to use generics or think they are bad for the language, why can't you just ignore them and not use them? On Thu, Mar 18, 2021 at 7:07 AM Space A. wrote: > Since pro-generics ppl here are struggling to provide any evidence of > existence of open and public

Re: [go-nuts] Re: build world question

2021-03-18 Thread Jan Mercl
On Thu, Mar 18, 2021 at 4:51 PM Brian Candler wrote: > OK. I'll just point out that if the repo contains a set of related packages, > then normally you'd only put a go.mod at the top level. I think the OP never mentioned a repository but "world". I infer that means all the repositories the OP

[go-nuts] Re: build world question

2021-03-18 Thread Brian Candler
OK. I'll just point out that if the repo contains a set of related packages, then normally you'd only put a go.mod at the top level. For an example of this in action, see the "testify" group of packages: https://github.com/stretchr/testify/ The subdirectories are separate packages. For

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Space A.
Since pro-generics ppl here are struggling to provide any evidence of existence of open and public discussion on the topic of dropping generics, I will do it myself. Here is it: https://groups.google.com/g/golang-nuts/c/LEEuJPOg0oo/m/-EZp3YSeBQAJ -- You received this message because you

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Space A.
The same as you just did, completely ignored everything I said in this thread. чт, 18 мар. 2021 г. в 16:25, Axel Wagner : > I find your response disrespectful. You are completely ignoring (in the > sense of "refusing to take notice of") what I wrote. > I don't think it is possible to have a

[go-nuts] Re: build world question

2021-03-18 Thread Hotei
Brian, Looks like a case of "pilot error". After tinkering a bit more it started to work. Each directory has its own go.mod file. Took a little while to figure out what the module wanted to see for versioning but that's seems to be sorted now. Still have a large number of projects to

Re: [go-nuts] No generic, part -2

2021-03-18 Thread 'Axel Wagner' via golang-nuts
I find your response disrespectful. You are completely ignoring (in the sense of "refusing to take notice of") what I wrote. I don't think it is possible to have a productive conversation as long as you behave this way. On Thu, Mar 18, 2021 at 1:48 PM Space A. wrote: > That's exactly what I'm

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Robert Engels
One other point on this. Generics will be trivial for 95% of the people - they will only need to be able to read and write the instantiation statements of type safe collections. Most developers don’t write the generic implementations - these are provided by library authors. As I’ve said

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Space A.
That's exactly what I'm saying, topic of dropping generics was never raised, so landing of some version of generics was implied by the process. In fact just a start of that process implied that dropping them entirely was never a question. There was no public discussion with that regard, no

Re: [go-nuts] No generic, part -2

2021-03-18 Thread 'Axel Wagner' via golang-nuts
ISTM that we already provided a bunch of evidence, which you are rejecting. so "any evidence" clearly is not good enough and you should be a bit more specific. Just to name a few specific examples of evidence provided: • The FAQ, as well as any interview of the question, have stated clearly that

Re: [go-nuts] No generic, part -2

2021-03-18 Thread ma...@eliasnaur.com
On Thursday, 18 March 2021 at 13:11:33 UTC+1 Space A. wrote: > > What kind of proof would you find to be acceptable? Can you give an > example of something that I could say that you would consider to be a > good answer to that question? Thanks. > > Ian, seriously. ANY evidence please, which

Re: [go-nuts] Re: now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread Space A.
Btw, when this started (see original thread) I compared some main pages of websites of popular languages. And you know what? I didn't find stupid banner on Java or Rust websites, and on many others. Maybe they were smart enough to show it only to US visitors, idk. Anyways, Russ Cox obviously

Re: [go-nuts] No generic, part -2

2021-03-18 Thread Space A.
> What kind of proof would you find to be acceptable? Can you give an example of something that I could say that you would consider to be a good answer to that question? Thanks. Ian, seriously. ANY evidence please, which you think "proves" that there was an open and public discussion on

Re: [go-nuts] Re: No generic, part -2

2021-03-18 Thread 'Axel Wagner' via golang-nuts
On Thu, Mar 18, 2021 at 12:06 PM wilk wrote: > It is still possible to write a formal proposal "canceling generics" if > someone find now a good reason, right ? (at the time of modules i > believe it was). > I believe it is. We can always change things in response to new information - we could,

[go-nuts] Re: No generic, part -2

2021-03-18 Thread wilk
On 17-03-2021, Ian Lance Taylor wrote: > On Wed, Mar 17, 2021 at 4:28 AM Space A. wrote: >> >> Can you provide any proof that there was an open public discussion? > > What kind of proof would you find to be acceptable? Can you give an > example of something that I could say that you would

Re: [go-nuts] Use cases for custom ResponseWriter

2021-03-18 Thread Amit Saha
On Wed, Mar 17, 2021 at 8:54 PM Amnon wrote: > > > https://github.com/gorilla/handlers > contains a number of ResponseWriters to provide functions such as compression > and logging > On Wednesday, 17 March 2021 at 08:41:09 UTC be...@pferdewetten.de wrote: >> >> net/http/httptest contains an

[go-nuts] Re: %v for []string{} and []string{""}

2021-03-18 Thread Brian Candler
Sure. I don't have a problem with nil slice and empty slice showing the same, because in all important ways they behave the same - i.e. they have len() of 0, you can append() to them, etc. The only behavioural difference I can think of is if you explicitly test "foo == nil". However, a slice