Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-23 Thread Ian Lance Taylor
On Wed, Jul 22, 2020 at 9:41 PM Aleksey Tulinov wrote: > > This is Java-style inheritance. It isn't bad, but i think that > C++-style composition is somehow more in the spirit of Go. Strictly > personal opinion of course. Older proposal described constraints as > expressions, so to me it appears

Re: [go-nuts] Generics syntax: declaring a generic type

2020-07-23 Thread Ian Lance Taylor
On Wed, Jul 22, 2020 at 9:36 PM burak serdar wrote: > > This is a suggestion about the declaration of a generic type. There is > something unnatural in the syntax: > > type SomeIntf(type T) interface { > ... > } > > type SomeStruct(type T) struct { > ... > } > > func SomeFunc(type T)(...) {...}

Re: [go-nuts] Go Present slide syntax supported by talks.godoc.org

2020-07-23 Thread Sebastien Binet
hi, I don't know what are the plans for this feature, but here is an issue that tracks its status: https://github.com/golang/gddo/issues/680 hth, -s ‐‐‐ Original Message ‐‐‐ On Thursday, July 23, 2020 12:34 AM, Tong Sun wrote: > Hi, > > I want to use the new Markdown Syntax instead

[go-nuts] Question on gofmt and go vet and field tag keys

2020-07-23 Thread Markus Heukelom
Is there a way to instruct gofmt (or another tool) to reformat field tags such that the keys are aligned? For example: type Example struct { Field1 string `json:"x" db:"y"` Field2 int `json:"ababababc" db:"def"` Field3 string `json:"zyx" db:"egh"` Field4 string `json:"z" db:"q"` } Would be

Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-23 Thread Aleksey Tulinov
Ian, First of all, thank you for taking your time to answer this topic. I know some stuff i say is dumb, i appreciate your patience. To answer your question: i would assume that OR is about as useful as AND or NOT. type Constraint interface { Sequence && !Channel } With that said. So far

Re: [go-nuts] template

2020-07-23 Thread Tharaneedharan Vilwanathan
Hi Lutz, Sorry I was not clear earlier. Yes, this is regarding Go HTML template. We use beego and HTML templates under that. We generally use nested templates in which we have nested if conditions as needed and for loop (range). We also do some minor computation, etc. I feel over time, the

[go-nuts] pointer receiver basic question

2020-07-23 Thread Robert Solomon
Hi. I'm going thru the example code for container/heap. In the documentation is this example: func (h *IntHeap) Pop() interface{} { old := *h n := len(old) x := old[n-1] *h = old[0 : n-1] // my question is about this line. return x } Why does the last assignment have to assign to a

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-23 Thread Michael Cohen
Thanks Ian, this does not work as I mentioned because there is no way to guarantee that my init function will run before any of my libraries creating a time object (which many do as they start various background tasks). Doing what you say is fragile because even if it appears to work, one day I

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-23 Thread Jason E. Aten
> I want to change Local because I want all JSON encoding to be normalized to UTC and not local time - there does not seem to be a way to do this (please let me know if I am missing something). Yes, you are missing something. This is very easy. Do not change Local. Just use the In() method on

[go-nuts] I made casual file transfer tool. and wana know your opinion.

2020-07-23 Thread 加藤泰隆
I have many machine. desktop, note, raspberry pi, and Android smart phones.. I wish easy file transfer to there. But, In the tools I know of, not easy. Therefore, I made tools by Golang! https://github.com/yasutakatou/doukie https://github.com/yasutakatou/andoukie auto sync mode is don't need to

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-23 Thread scudette
A bit late to the party here but I would like to explore your rational for stating that time.Local should not be modified by user code. The code seems to suggest this is expected: https://golang.org/src/time/zoneinfo.go ``` // localLoc is separate so that initLocal can initialize76 // it

[go-nuts] Re: I made casual file transfer tool. and wana know your opinion.

2020-07-23 Thread Brian Candler
Have you looked at syncthing (also in go)? It also uses QR codes for setup, but these contain crypto public keys rather than IP addresses. It has an Android client. You may be able to steal ideas. -- You received this message because you are

Re: [go-nuts] Using GTSM with GRPC

2020-07-23 Thread Matthew Walster
On Wed, 22 Jul 2020 at 23:30, Robert Engels wrote: > Your network is setup wrong... if you are relying on a router to enforce > ttl decrement for security. You can more easily prevent IP spoofing on the > local net (or at the router) and then just verify the IP network portion is > correct.

Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-23 Thread Ian Lance Taylor
On Thu, Jul 23, 2020 at 1:12 AM Aleksey Tulinov wrote: > > First of all, thank you for taking your time to answer this topic. I > know some stuff i say is dumb, i appreciate your patience. > > To answer your question: i would assume that OR is about as useful as > AND or NOT. > > type Constraint

[go-nuts] Re: I made casual file transfer tool. and wana know your opinion.

2020-07-23 Thread 加藤泰隆
I welcome your message. I didn't know this app and transfer details. Certainly, QR Code can send more informations. My app are not good enough. But, For example, My app is not support https. So,My app local network use case only. It's not flexible for improve. This problem depend used plugin on

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-23 Thread Ian Lance Taylor
On Thu, Jul 23, 2020 at 5:13 PM Michael Cohen wrote: > > Thanks Ian, this does not work as I mentioned because there is no way to > guarantee that my init function will run before any of my libraries creating > a time object (which many do as they start various background tasks). > > Doing what

Re: [go-nuts] pointer receiver basic question

2020-07-23 Thread Ian Lance Taylor
On Thu, Jul 23, 2020 at 5:27 PM Robert Solomon wrote: > > Hi. I'm going thru the example code for container/heap. In the > documentation is this example: > > func (h *IntHeap) Pop() interface{} { > old := *h > n := len(old) > x := old[n-1] > *h = old[0 : n-1] // my question is about this

Re: [go-nuts] Weird problem that CPU is nearly 100%

2020-07-23 Thread tokers
We detected this problem once again, and this time we observed the stacks. See https://github.com/golang/go/issues/40372 for the details. On Friday, May 22, 2020 at 3:25:39 PM UTC+8 Jan Mercl wrote: > On Fri, May 22, 2020 at 9:05 AM tokers wrote: > > > > Thanks for you reply. > > > > Yeah, we

[go-nuts] Re: Go 1.15 Beta 1 is released

2020-07-23 Thread Alexander Rakoczy
Hello again, gophers, Our last release-blocking issue for Go 1.15 RC1 has been resolved. We are working on releasing Go 1.15 RC1 soon. Thank you for your patience and for all of your help to make Go 1.15 the best Go release ever. We're excited to hear your feedback testing the RC. Cheers, Alex

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-23 Thread Ian Lance Taylor
On Thu, Jul 23, 2020 at 9:47 AM wrote: > > A bit late to the party here but I would like to explore your rational for > stating that time.Local should not be modified by user code. The code seems > to suggest this is expected: > > https://golang.org/src/time/zoneinfo.go > ``` > > // localLoc is

Re: [go-nuts] Using GTSM with GRPC

2020-07-23 Thread Robert Engels
If they are on the same subnet why not prohibit incoming traffic on the TCP port used by the gRPC at the router for the subnet using a simple firewall - the traffic DoS traffic must be hitting the router first (because that is where the TTL reduction would occur anyway) > On Jul 23, 2020, at