Re: [go-nuts] querying whether the go command would run in module mode

2019-12-08 Thread Paul Jolly
go env GOMOD - gives the path to the go.mod in use in module mode, and is empty otherwise (i.e. GOPATH mode) On Mon, 9 Dec 2019, 00:25 Dan Kortschak, wrote: > Is there a way to query whether an invocation of the go command would > be running in module mode? > > thanks > Dan > > -- > You received

[go-nuts] Re: Is a public go benchmarking database/dashboard available

2019-12-08 Thread Xiangdong JI
Hi Tong, I meant public performance data from regular benchmarkings of public Go benchmark sets, say the 'go1' set. It could serve multiple purposes, as a source of perf. tuning investigation, for cross-checking with internal data, etc. I'm not proposing a 'cover-it-all' one but looking for dat

Re: [go-nuts] Why runtime.sigtrampgo calls runtime.morestack?

2019-12-08 Thread changkun
That's a really useful workaround! It makes much more sense now. Conclusion: when `sigtramp` is returned, nothing is called before entering `ayncPreempt`. Thank you so much for releasing me from confusing :) sigtramp is returned asyncPreempt is called OK CALL runtimeĀ·sigtrampgo(SB) CALL run

[go-nuts] Microsoft Graph for Go

2019-12-08 Thread Bill Nixon
I've been playing with Go and Microsoft Graph and decided to combine the two and have been writing a "wrapper" API to the RESTful Microsoft Graph APIs.The source is available at https://github.com/bnixon67/msgraph4go Microsoft Graph exposes REST APIs and client libraries to access data on vario

[go-nuts] querying whether the go command would run in module mode

2019-12-08 Thread Dan Kortschak
Is there a way to query whether an invocation of the go command would be running in module mode? thanks Dan -- 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 golan

Re: [go-nuts] Why runtime.sigtrampgo calls runtime.morestack?

2019-12-08 Thread Ian Lance Taylor
On Sun, Dec 8, 2019 at 1:10 PM changkun wrote: > > Thank you so much for your hint, I think I've figured it out. > The root cause seems similar to the "uncertainty principle". > > As an observer, by adding a `println` call in `asyncPreempt` > as well as `asyncPreempt2` influences the actual behavi

[go-nuts] Re: whenceReader

2019-12-08 Thread hanisch
The type definition above should read: type whenceReader struct { rio.ReaderAt off int64 } (I forgot to put the package name (i.e., "io." in front of ReaderAt.) On Sunday, December 8, 2019 at 6:19:04 PM UTC-5, William Hanisch wrote: > > Suppose you (okay, okay, I) wan

[go-nuts] whenceReader

2019-12-08 Thread hanisch
Suppose you (okay, okay, I) want something like an io.SectionReader but don't want to specify the end point of the section, just the start. That is, method calls to Read should only return EOF when at the end of the underlying source of the initially supplied io.ReaderAt. This can be achieved,

Re: [go-nuts] Why runtime.sigtrampgo calls runtime.morestack?

2019-12-08 Thread changkun
Dear Ian, Thank you so much for your hint, I think I've figured it out. The root cause seems similar to the "uncertainty principle". As an observer, by adding a `println` call in `asyncPreempt` as well as `asyncPreempt2` influences the actual behavior after signal handling. The `println` involv

Re: [go-nuts] rpc.debugLog unexported

2019-12-08 Thread Ian Lance Taylor
On Sun, Dec 8, 2019 at 10:07 AM wrote: > > Thanks for your reply. Do you regularly edit standard libs as described (and > then presumably edit them back)? While debugging the standard library, yes, I do. But I also agree that for this case it might be useful to have a more usable mechanism. >

Re: [go-nuts] Why runtime.sigtrampgo calls runtime.morestack?

2019-12-08 Thread Ian Lance Taylor
On Sun, Dec 8, 2019 at 7:02 AM changkun wrote: > > As we all know that a program is interrupted by a signal and entering kernel > space then switch to a userspace signal handler. After the signal handler is > accomplished, it will be reentering the kernel space then switch back to > where was i

Re: [go-nuts] rpc.debugLog unexported

2019-12-08 Thread dick . r . chiang
Thanks for your reply. Do you regularly edit standard libs as described (and then presumably edit them back)? I copied /usr/lib/go-1.13/net/rpc to my project directory, then changed all imports of "net/rpc" to "./net/rpc", and then set debugLog (in my shadow copy, not /usr/lib/go-1.13). It got t

Re: [go-nuts] Reordering error output in flags package so Usage is printed before the error?

2019-12-08 Thread andrey mirtchovski
You'll need to create a FlagSet instead and pass ContinueOnError as the error handling. If .Parse() returns an error call .PrintDefaults(), then print the error. On Sun, Dec 8, 2019 at 4:00 AM Thomas Nyberg wrote: > > Hello, > > Given the following file `flag_example.go`: > > package main > > imp

Re: [go-nuts] Looking for an app w/ mult. versions of a dependency

2019-12-08 Thread Paul Jolly
> I'm wondering if any of you other nuts can point out examples? It's a hypothetical example but perhaps shows enough of what you're after? https://github.com/go-modules-by-example/index/blob/master/015_semantic_import_versioning/README.md -- You received this message because you are subscribed

[go-nuts] Why runtime.sigtrampgo calls runtime.morestack?

2019-12-08 Thread changkun
As we all know that a program is interrupted by a signal and entering kernel space then switch to a userspace signal handler. After the signal handler is accomplished, it will be reentering the kernel space then switch back to where was interrupted. I am recently reading the newly implemented a

[go-nuts] Re: Reordering error output in flags package so Usage is printed before the error?

2019-12-08 Thread Thomas Nyberg
Hello, I looked at the source and noticed that if I move the following line up two lines I guess basically what I'm looking for: https://github.com/golang/go/blob/master/src/flag/flag.go#L874 But this is changing an unexported function. Is there a way to do something like this without messing

[go-nuts] Reordering error output in flags package so Usage is printed before the error?

2019-12-08 Thread Thomas Nyberg
Hello, Given the following file `flag_example.go`: package main import "flag" func main() { flagName := flag.String("flagName", "flagValue", "Help message.") flag.Parse() _ = flagName } If I execute it with a bad flag passed I see the following: $ ./flag_example -flagName flag nee