Re: [go-nuts] Definition of Method sets

2020-09-04 Thread Yuu LongXue
yeah,this is really a subtle point, Thank You For Your Addition. > On Sep 4, 2020, at 10:11 PM, Marvin Renich wrote: > > Marvin -- 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,

Re: [go-nuts] Asynchronous preemption

2020-09-04 Thread Ian Lance Taylor
On Wed, Sep 2, 2020 at 9:11 PM Yonatan Gizachew wrote: > > I see. If that is so, what is the job of sysmon thread? The sysmon thread is not related to asynchronous preemption. The sysmon thread does a few different things. One of the things it does is notice threads that have been stuck in a sy

Re: [go-nuts] What is The compiler's -json optimization logging

2020-09-04 Thread 'David Chase' via golang-nuts
There is also a command-line proof-of-concept that combines it with profiling information to show you only the missed/unabled optimizations that are also hot spots in the profile. https://github.com/dr2chase/gc-lsp-tools There's a lot of checks and things that can't be optimized away, but very fe

Re: [go-nuts] Deep printing in the reflect package

2020-09-04 Thread Ian Lance Taylor
On Fri, Sep 4, 2020 at 2:57 PM aind...@gmail.com wrote: > > I agree that this functionality can be implemented outside the standard > library. However, traversing nested data structures does seem to fall into > reflect's domain. In particular, one would have to deal with unexported > fields and

Re: [go-nuts] Deep printing in the reflect package

2020-09-04 Thread aind...@gmail.com
I agree that this functionality can be implemented outside the standard library. However, traversing nested data structures does seem to fall into reflect's domain. In particular, one would have to deal with unexported fields and pointer cycles. I can also see how a newcomer would think the sta

Re: [go-nuts] What is The compiler's -json optimization logging

2020-09-04 Thread 温博格
And gopls will compute them as diagnostics. For instance, if using vscode and gopls, then in setting.json: "gopls": { "codelens": { "gc_details": true, } } and a clickable 'Toggle gc annotation details' should appear just above the package statement. On Fri, Sep 4, 2020 at 4:28 PM Ian Lan

Re: [go-nuts] What is The compiler's -json optimization logging

2020-09-04 Thread Ian Lance Taylor
[ + drchase ] On Fri, Sep 4, 2020 at 1:16 PM Falco Wockenfuß wrote: > > sorry if this is a dumb question, but the Release Notes for go 1.15 have the > Note: > The compiler's -json optimization logging now reports large (>= 128 byte) > copies and includes explanations of escape analysis decision

Re: [go-nuts] Deep printing in the reflect package

2020-09-04 Thread Ian Lance Taylor
On Fri, Sep 4, 2020 at 1:11 PM aind...@gmail.com wrote: > > Often on my team, Go programmers (particularly new ones) simply want full > visibility into a data structure when debugging. For those who aren't > familiar with pointers, seeing a hexadecimal number show up in a log can be > really fr

[go-nuts] What is The compiler's -json optimization logging

2020-09-04 Thread Falco Wockenfuß
Hi, sorry if this is a dumb question, but the Release Notes for go 1.15 have the Note: The compiler's -json optimization logging now reports large (>= 128 byte) copies and includes explanations of escape analysis decisions. But I didn't find anything about "-json" as a flag for go build or sim

[go-nuts] Deep printing in the reflect package

2020-09-04 Thread aind...@gmail.com
Often on my team, Go programmers (particularly new ones) simply want full visibility into a data structure when debugging. For those who aren't familiar with pointers, seeing a hexadecimal number show up in a log can be really frustrating. I usually point them to https://github.com/davecgh/go-s

[go-nuts] Re: [ generics] Moving forward with the generics design draft

2020-09-04 Thread Denis Cheremisov
> But I don't think that using type list constraint as sum types is good idea. > Type constraints should be known in compile-time, but the sum type variant should be known in run-time. It looks like you misunderstand it a bit. Indeed type Constraint interface { type Type₁, Type₂, …, Typeₙ }

[go-nuts] Re: [ generics] Moving forward with the generics design draft

2020-09-04 Thread tdakkota
I'd like to see sum types in Go2 and there are many reasons: - It can make using oneOf/anyOf in protobuf or swagger mush easier. - It can make ast.Node type-safe. - With sum-types compiler known maximum size of variant, so it can be allocated on stack, not on heap. But I don't think that using

Re: [go-nuts] Workflow and tools for JSON Schema generation

2020-09-04 Thread Marcin Romaszewicz
Oh wow, my email client showed your email in a truncated way, so i didn't see you were already using my project, sorry for the silly response. It would be possible to add external type definitions to oapi-codegen, I believe. I'm in the process of thinking about a v2 version which is more stable, a

Re: [go-nuts] Workflow and tools for JSON Schema generation

2020-09-04 Thread Marcin Romaszewicz
Have you considered reversing the workflow? You write the OpenAPI spec, and have a code generator produce the Schemas and server boilerplate? If that's ok, check out my project :) https://github.com/deepmap/oapi-codegen We successfully use it for many API's in production. -- Marcin On Thu, Sep

Re: [go-nuts] Definition of Method sets

2020-09-04 Thread Marvin Renich
* Yuu LongXue [200904 05:31]: > Hi all, > > I’m confused by the "method set" defined in go > specification,any one can help explain? > > The Go Programming Language Specification says that : > ``` > The method set of any other type T consists of all methods >

[go-nuts] A tool to create tag values as string const

2020-09-04 Thread Amarjeet Anand
Hi I wrote a tool to generate the tag values as string constant. It can filter out the structs to be parsed, based on a magic comment(if needed). Do you feel this can be of any use? May I have your opinion on this? https://github.com/amarjeetanandsingh/tgcon -- You received this message becau

[go-nuts] Re: save context, when switch goroutine?

2020-09-04 Thread xie cui
I find the mcall function! On Friday, September 4, 2020 at 6:13:54 PM UTC+8 xie cui wrote: > as we know, call function gogo can jump to other other goroutine. when > goroutine1 switch to goroutine2 it must save the current context of > goroutine1(sp pc. so). i can find the function runtime·gosa

[go-nuts] save context, when switch goroutine?

2020-09-04 Thread xie cui
as we know, call function gogo can jump to other other goroutine. when goroutine1 switch to goroutine2 it must save the current context of goroutine1(sp pc. so). i can find the function runtime·gosave to save current context, but i cann't find where the code call gosave, can some explain when

[go-nuts] Re: Definition of Method sets

2020-09-04 Thread Brian Candler
On Friday, 4 September 2020 10:31:11 UTC+1, Yuu LongXue wrote: > > Hi all, > > I’m confused by the "method set" defined in go specification,any > one can help explain? > > The Go Programming Language Specification says that : > ``` > The method set of any other

[go-nuts] Definition of Method sets

2020-09-04 Thread Yuu LongXue
Hi all, I’m confused by the "method set" defined in go specification,any one can help explain? The Go Programming Language Specification says that : ``` The method set of any other type T consists of all methods declared with receiver type T. The method set of th