[go-nuts] Use cases for custom ResponseWriter

2021-03-16 Thread Amit Saha
Hi all, I came across the need for writing a custom ResponseWriter when I wanted to log the response status code. Is there any other use case where this is needed to implement one? Thanks and appreciate any pointers. Best Regards, Amit. -- You received this message because you are subscribed t

Re: [go-nuts] addressing the issue of correlating built in structured types in generic code: float/complex

2021-03-16 Thread Ian Lance Taylor
On Sun, Mar 14, 2021 at 2:59 PM 'Dan Kortschak' via golang-nuts wrote: > > Now that a proposal for an approach to generics has been approved[1], > it seems like a good time to again[2] raise the issue of how to be able > to write code that has correlated types where types are structured but > buil

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

2021-03-16 Thread Ian Lance Taylor
On Tue, Mar 16, 2021 at 7:34 AM Space A. wrote: > > Go will loose its uniqueness and values, will never become a next big thing. > No cross platform GUI, no Android, and browsers (GopherJS is more dead than > alive, WASM idk) is also a big question. It will be a "bad copy" of Java or > other ma

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

2021-03-16 Thread Ian Lance Taylor
On Tue, Mar 16, 2021 at 6:51 AM Space A. wrote: > > > (To be clear, your original claim was that there *was* no discussion - > > which is at least easy to address, because it's clearly not true. There was > > over three years of active discussion on this) > > No, and I can repeat, there was no (

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

2021-03-16 Thread Ian Lance Taylor
On Tue, Mar 16, 2021 at 4:00 AM Space A. wrote: > > > The design draft was put up for discussion for months before it became > a formal proposal. It was not new. > > There is always a "discussion", most people (as well as I) will look only at > the final version of proposal, if and when they hav

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

2021-03-16 Thread Ian Lance Taylor
On Mon, Mar 15, 2021 at 11:10 PM Jan Mercl <0xj...@gmail.com> wrote: > > - We can create a hypothesis, that if only people coding in Go for > more than N years, the results may get very different or even > inverted. Due to the above we cannot decide the validity of the > hypothesis. The validity co

Re: [go-nuts] How to search standard libarary?

2021-03-16 Thread colourdelete
I usually search on pkg.go.dev: https://pkg.go.dev/std This page lists the standard libraries, and I Google with site:https://pkg.go.dev/std Rename. On Tuesday, March 16, 2021 at 11:59:31 a.m. UTC-4 Jan Mercl wrote: > On Tue, Mar 16, 2021 at 4:53 PM jake...@gmail.com > wrote: > > > It seems l

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

2021-03-16 Thread Space A.
One more person pro-generics switching the topic to my personality and telling me what to do and what my problem is. вт, 16 мар. 2021 г. в 18:26, CreateSpaceMap : > Sorry, I might sound a little blunt but this pique my curiosity, how much > time have you invest in Go and what do you earn for a li

Re: [go-nuts] How to search standard libarary?

2021-03-16 Thread Jan Mercl
On Tue, Mar 16, 2021 at 4:53 PM jake...@gmail.com wrote: > It seems like a real oversight that there is no search on the official go > documentation though. It seems like it would be really helpful, especially to > beginners. I would love to hear from someone involved why the go team decided >

Re: [go-nuts] How to search standard libarary?

2021-03-16 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 16 March 2021 at 16:53:01 UTC+1 jake...@gmail.com wrote: > I would love to hear from someone involved why the go team decided to > remove this feature from the official Go website. > The reasons for removing the search are documented in the accompanying issue: https://github.com/g

Re: [go-nuts] How to search standard libarary?

2021-03-16 Thread jake...@gmail.com
On Tuesday, March 16, 2021 at 11:31:51 AM UTC-4 eli...@gmail.com wrote: > I really like devdocs.io for this > > You type "Go" and TAB, and then it will only autocomplete in the Go stdlib. > Thanks, that seems to do what I want. It seems like a real oversight that there is no search on the offic

[go-nuts] Re: How to search standard libarary?

2021-03-16 Thread jake...@gmail.com
On Tuesday, March 16, 2021 at 11:28:06 AM UTC-4 Carla Pfaff wrote: > On Tuesday, 16 March 2021 at 15:09:25 UTC+1 jake...@gmail.com wrote: > >> Any suggestions? > > > You can use this: https://cs.opensource.google/go > While that may be useful in its own way, it is not useful for what UI asked f

Re: [go-nuts] How to search standard libarary?

2021-03-16 Thread Eli Bendersky
I really like devdocs.io for this You type "Go" and TAB, and then it will only autocomplete in the Go stdlib. On Tue, Mar 16, 2021 at 7:09 AM jake...@gmail.com wrote: > > For years now, when I needed to casually lookup a standard library > function I would use the search on the website. Like

[go-nuts] Re: How to search standard libarary?

2021-03-16 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 16 March 2021 at 15:09:25 UTC+1 jake...@gmail.com wrote: > Any suggestions? You can use this: https://cs.opensource.google/go -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

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

2021-03-16 Thread CreateSpaceMap
Sorry, I might sound a little blunt but this pique my curiosity, how much time have you invest in Go and what do you earn for a living? You can assure Go didn't just happen to be popular, they are built with blood and sweat, what have you done along the way? Countless of developers accept Gener

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

2021-03-16 Thread CreateSpaceMap
You have a unique thought, you would consider V language if that is what you have been thinking about. On Tuesday, March 16, 2021 at 10:35:01 PM UTC+8 Space A. wrote: > Go will loose its uniqueness and values, will never become a next big > thing. No cross platform GUI, no Android, and browsers

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

2021-03-16 Thread Space A.
Go will loose its uniqueness and values, will never become a next big thing. No cross platform GUI, no Android, and browsers (GopherJS is more dead than alive, WASM idk) is also a big question. It will be a "bad copy" of Java or other mature languages (with better and more powerful generics and lot

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

2021-03-16 Thread 'Axel Wagner' via golang-nuts
On Tue, Mar 16, 2021 at 2:51 PM Space A. wrote: > No, and I can repeat, there was no (public) discussion on whether the idea > of generics in Go should be completely dropped. It *was* always a > "discussion" of how to improve and implement generics in a Go way, but not > of generics themselves as

[go-nuts] How to search standard libarary?

2021-03-16 Thread jake...@gmail.com
For years now, when I needed to casually lookup a standard library function I would use the search on the website. Like https://golang.org/search?q=Rename. This no longer works, and the search box on the Go website and "Package Documentation" page is now gone. Has this moved somewhere else? H

[go-nuts] Re: Testing using mock functionality

2021-03-16 Thread Pascal de Kloe
The structure encourages people to use function variables instead of method invocation (on an object or interface). Do the initialisation from main and the unit tests simply mock or stub the relevant calls per method. func Tes

Re: [go-nuts] Is there a final document on generics?

2021-03-16 Thread Haddock
> One addition to my last mail: There are some drafts of generic packages in > the > dev.go2http://dev.go2gohttps://github.com/golang/go/tree/dev.go2go/src/cmd/go2go/testdata/go2path/srcgo > > > > branch. > Th

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

2021-03-16 Thread Space A.
> (To be clear, your original claim was that there *was* no discussion - which is at least easy to address, because it's clearly not true. There was over three years of active discussion on this) No, and I can repeat, there was no (public) discussion on whether the idea of generics in Go should be

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

2021-03-16 Thread 'Axel Wagner' via golang-nuts
On Tue, Mar 16, 2021 at 1:24 PM Space A. wrote: > That's absolutely up to you, but some of us (including myself) can't > invest so much time because we have to earn money for living. > As I said, I understand that reality. It is unfortunate, but given that language design takes time and effort,

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

2021-03-16 Thread wilk
On 16-03-2021, Space A. wrote: >> This seems very dismissive of the many members of the community which > *did* invest the time and energy to discuss the design for the past years. > When the contracts design was announced in 2018 >, the process was explained. Inc

Re: [go-nuts] Is there a final document on generics?

2021-03-16 Thread Robert Engels
Your snotty attacks are duly noted. Says a lot about you. Find me an engineer that doesn’t build on the backs of others and I’ll show you a very poor engineer. The collections api was provided along with the delivery of generics in Java for two main purposes: it dissuaded the proliferation of

Re: [go-nuts] Re: [ANN] New german translations

2021-03-16 Thread Gregor Best
That somehow reminds me of one of my professors in university who (probably on account of his near-retirement age) insisted on calling recursive descent parsers "rekursive Abstiegszerteiler". On 16.03.21 11:10, Haddock wrote: Anyhow, if I hear how young people are talking nowadays, it makes me

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

2021-03-16 Thread Space A.
> This seems very dismissive of the many members of the community which *did* invest the time and energy to discuss the design for the past years. When the contracts design was announced in 2018 , the process was explained. Including the fact that it is a draft, wh

Re: [go-nuts] Is there a final document on generics?

2021-03-16 Thread Jan Mercl
On Tue, Mar 16, 2021 at 1:10 PM 'Axel Wagner' via golang-nuts wrote: > On Tue, Mar 16, 2021 at 1:05 PM Robert Engels wrote: >> >> Failure to provide a standard “collections” package would be a huge mistake. >> It is certainly a top 3 reason for the success of Java. It would be probably a huge

Re: [go-nuts] Is there a final document on generics?

2021-03-16 Thread 'Axel Wagner' via golang-nuts
There is a difference between "failing to provide one" and "waiting with its design until generics have been implemented". One addition to my last mail: There are some drafts of generic packages in the dev.go2http://dev.go2gohttps://github.com/golang/go/tree/dev.go2go/src/cmd/go2go/testdata/go2pat

Re: [go-nuts] Is there a final document on generics?

2021-03-16 Thread Robert Engels
Failure to provide a standard “collections” package would be a huge mistake. It is certainly a top 3 reason for the success of Java. > On Mar 16, 2021, at 6:52 AM, 'Axel Wagner' via golang-nuts > wrote: > >  > The very detailed design doc is linked in the proposal issue. That's the > design

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

2021-03-16 Thread 'Axel Wagner' via golang-nuts
On Tue, Mar 16, 2021 at 12:00 PM Space A. wrote: > There is always a "discussion", most people (as well as I) will look only > at the final version of proposal, if and when they have time. And what's > the point of having formal proposals if you don't respect that process? > Once you published, p

Re: [go-nuts] Re: [ANN] New german translations

2021-03-16 Thread Wojciech S. Czarnecki
Dnia 2021-03-16, o godz. 03:10:02 Haddock napisał(a): > Anyhow, if I hear how young people are talking nowadays, it makes me sick. Plato schrieb am Montag, 8. März ungefähr 489 vor Christus: As we all know, Socrates often said that “The children now love luxury; they have bad m

Re: [go-nuts] Is there a final document on generics?

2021-03-16 Thread 'Axel Wagner' via golang-nuts
The very detailed design doc is linked in the proposal issue . That's the design that is currently targeted for implementation. It is possible that it still chang

Re: [go-nuts] Re: [ANN] New german translations

2021-03-16 Thread 'Dan Kortschak' via golang-nuts
On Tue, 2021-03-16 at 03:10 -0700, Haddock wrote: > Anyhow, if I hear how young people are talking nowadays, it makes me > sick. Die Funktion wurde "gecalled" und die Exception "gethrown". > Sometimes I fear the next generation will not have learned to watch > what their mind is doing. I might be w

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

2021-03-16 Thread Space A.
> The design draft was put up for discussion for months before it became a formal proposal. It was not new. There is always a "discussion", most people (as well as I) will look only at the final version of proposal, if and when they have time. And what's the point of having formal proposals if yo

[go-nuts] Is there a final document on generics?

2021-03-16 Thread Haddock
Hello, I have lost a bit oversight how generics will look now in the final proposal that was accepted and is serving as the guideline to implement generics for Go 1.18 or later. There were too many proposals and discussions about them that I lost track. Is there some final document that descr

[go-nuts] Re: How to implement localhost proxy which injects Proxy-Authorization header to incoming request and sends it to another remote proxy with Go?

2021-03-16 Thread Hugo Bollon
Thank you for your advice that I applied. But now I have a *407 Proxy Authentication Required* error, while the header is added to the request... Here is the output: INFO[0019] Pre-Edited request: &{Method:CONNECT URL://google.com:443 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 Header:map[Proxy-Co

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

2021-03-16 Thread wilk
On 15-03-2021, Ian Lance Taylor wrote: > On Mon, Mar 15, 2021 at 3:11 PM atd...@gmail.com > wrote: >> >> I am in favor of the proposal but I think that accounting for popularity >> votes is not a good measure of things. >> A lot of people are at various stages of their technical journey in compu

[go-nuts] Re: [ANN] New german translations

2021-03-16 Thread Haddock
Anyhow, if I hear how young people are talking nowadays, it makes me sick. Die Funktion wurde "gecalled" und die Exception "gethrown". Sometimes I fear the next generation will not have learned to watch what their mind is doing. I might be wrong. I hope so. Haddock schrieb am Montag, 15. März 2

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

2021-03-16 Thread wilk
On 16-03-2021, Robert Engels wrote: > Very well said.=20 +1 -- wilk -- 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.

[go-nuts] Re: How to implement localhost proxy which injects Proxy-Authorization header to incoming request and sends it to another remote proxy with Go?

2021-03-16 Thread Vladimir Varankin
Hey there, Seems the issue hides in the chunk, where you overwrite reverse proxy's "Director" method, which NewSingleHostReverseProxy creates internally. Since your own director doesn't set the client request's Schema and Host, you have to either do that manually or make sure you call the origi