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

2021-03-19 Thread 'Tim Hockin' via golang-nuts
Thanks for feedback, comments below On Thu, Mar 18, 2021 at 3:35 PM Jay Conrod wrote: > > Installing a command within the context of the current module is more > complicated. I'd suggest this: > > # Add a dependency on the tool (only need to do this once) > go get -d github.com/google/go-license

Re: [go-nuts] How do you get an update for the tip of a package?

2021-03-19 Thread Shulhan
On Wed, 3 Mar 2021 07:06:36 -0800 (PST) Peter Kleiweg wrote: > I try to install a Go program from github at tip. > > This works: > > go get github.com/some/program@HEAD > > But when there is a new push to the repository, and I do this: > > go get -u github.com/some/program@HEAD > > .

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

2021-03-19 Thread Robert Engels
Generics support a library handling type-safe registry services. Using such a library will not require advanced generics understanding. > On Mar 19, 2021, at 11:53 AM, cpu...@gmail.com wrote: > > On Thursday, March 18, 2021 at 1:53:30 PM UTC+1 ren...@ix.netcom.com wrote: >> One other point on

Re: [go-nuts] Local mod version

2021-03-19 Thread Shulhan
On Fri, 19 Mar 2021 00:14:40 -0700 (PDT) Pierre Curto wrote: > Hello gophers, > > Trying to locally get the same semver string as if downloading it > from its git repo, and not succeeding. Any pointer? > > Thanks! > This may works or may not works depends on your OS: https://groups.google.co

[go-nuts] Re: nice user survey re Go-lang

2021-03-19 Thread David Skinner
Thank you for sharing. I think the most important things to learn from this survey are the problems identified. For example, This is an important opportunity for new users if they have not used the debug tools to take careful notes and create precise documentation for others. On Wednesday, M

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

2021-03-19 Thread David Skinner
> > 1. Since some time I don't know what "Go team" is. As Google put a > trademark on Go, and its own label on golang.org website, so they > obviously wanted that everyone was aware of who stands behind the project, > it would be correct to say "a group of Google employees". Those who are familiar

Re: [go-nuts] tmp var in generic func?

2021-03-19 Thread Ian Lance Taylor
On Fri, Mar 19, 2021 at 6:24 AM xie cui wrote: > > code: > func printvar[T any](){ > var t T > fmt.Println("T", t) > } > > printvar[int]() > > the function instantiate in cmd/compile will instantiate a generic func, > func (check *Checker) instantiate(pos syntax.Pos, typ Type, targs []Typ

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

2021-03-19 Thread Ian Lance Taylor
On Thu, Mar 18, 2021 at 8:36 PM Paul Zhang wrote: > > Can I just understand that for the default case, when the compiler executes > the mallocgc() for c.buf, it would use reflect to build the descriptor for > the type of element? And if it allocates the both spaces in one function > call, it wo

[go-nuts] Local mod version

2021-03-19 Thread Pierre Curto
Hello gophers, Trying to locally get the same semver string as if downloading it from its git repo, and not succeeding. Any pointer? Thanks! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving ema

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

2021-03-19 Thread cpu...@gmail.com
On Thursday, March 18, 2021 at 1:53:30 PM UTC+1 ren...@ix.netcom.com wrote: > 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

[go-nuts] Fixing deprecated: golang.org/x/oauth2: Transport.CancelRequest no longer does anything; use contexts

2021-03-19 Thread cpu...@gmail.com
Hi all, I've recently learned about oauth2 and started to convert some of my "manual" code using net/http to use an underlying oauth2.Transport for executing authenticated requests and token refresh. As a result, my application now sometimes shows deprecated: golang.org/x/oauth2: Transpo

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

2021-03-19 Thread Tamás Gulácsi
AFAIK when there's no pointer in elem (the channel's element's type), we can cheat/optimize (call as you wish), and allocate the channel's backing memory AND all it's elements' memory at once, AS A BYTE ARRAY (nil is the second argument of mallocgc). Then we can play unsafe tricks an treat it as

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

2021-03-19 Thread Tyler Compton
Believe it or not, that wasn't my intention at all. There certainly are other people unhappy with the generics proposal, and they were burned too. I was attempting to acknowledge your position compassionately while also arguing that things aren't nearly so bad as you say. Unfortunately, it seems y

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

2021-03-19 Thread Ian Lance Taylor
On Fri, Mar 19, 2021, 4:54 AM Space A. wrote: > > 2. Sure, Ian has revealed how that "consensus" was measured. By counting > "thumbs up", "thumbs down" and "confused" emojis. So Go is not driven by > polls, it's driven by emojis. > For the record, this statement is false. That is not what I sa

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

2021-03-19 Thread Ian Lance Taylor
On Fri, Mar 19, 2021, 4:30 AM Space A. wrote: > Two of them are recent discussions which I was part of, and yet another is > also a recent post, not really a discussion since there are 2 messages in > thread, just an opinion. > So yea, thank you for proving my words. > You asked for some proof t

[go-nuts] tmp var in generic func?

2021-03-19 Thread xie cui
code: func printvar[T any](){ var t T fmt.Println("T", t) } printvar[int]() the function instantiate in cmd/compile will instantiate a generic func, func (check *Checker) instantiate(pos syntax.Pos, typ Type, targs []Type, poslist []syntax.Pos) (res Type) but i look into the implement,

Re: [go-nuts] about untyped type?

2021-03-19 Thread Jan Mercl
On Fri, Mar 19, 2021 at 1:47 PM xie cui wrote: > https://github.com/golang/go/blob/master/src/cmd/compile/internal/types2/universe.go#L58-L64 > there are some basic type call untyped xxx? what is it mean? Untyped bool, int, etc are the types of untyped constants: https://golang.org/ref/spec#Cons

[go-nuts] about untyped type?

2021-03-19 Thread xie cui
https://github.com/golang/go/blob/master/src/cmd/compile/internal/types2/universe.go#L58-L64 there are some basic type call untyped xxx? what is it mean? when will go compiler use them? can you show in example? -- You received this message because you are subscribed to the Google Groups "golang-

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

2021-03-19 Thread Space A.
Ok so this is a nice post. What you are trying to do with it is to make an impression that there is only I in the whole Universe who was unhappy with that proposal. It's not true. Open the issue and read down below comments by other people. Some others who might also wanted to give their feedback c

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

2021-03-19 Thread Space A.
Two of them are recent discussions which I was part of, and yet another is also a recent post, not really a discussion since there are 2 messages in thread, just an opinion. So yea, thank you for proving my words. чт, 18 мар. 2021 г. в 22:00, Ian Lance Taylor : > On Thu, Mar 18, 2021 at 5:11 AM

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

2021-03-19 Thread Jan Mercl
On Fri, Mar 19, 2021 at 4:36 AM Paul Zhang wrote: Please do not post colorized code to the ML. Particularly with inverted colors. Please use plain black on white text, thank you. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fr