[go-nuts] Re: how to get the full path of current process' executable file

2020-01-07 Thread Eric Chai
Moved to https://github.com/kardianos/osext On Thursday, March 13, 2014 at 3:54:29 PM UTC+8, Dobrosław Żybort wrote: > > Too bad you did not search on stackoverflow: > http://stackoverflow.com/a/15038241/1722542 > > My answer there: > > Use package bitbucket.org/kardianos/osext. > > It's providing

[go-nuts] performance improvements

2020-01-07 Thread robert engels
Shout out to the Go team on a job well done. I took the time to re-run some benchmarks, here are the results (both 1.9.7 and 1.13.5 re-run on same hardware & OS). >From fixed iMac:tmp robertengels$ benchcmp bench_1_9_7.txt bench_1_13_15.txt benchmark

Re: [go-nuts] How to reduce the fluctuation of micro benchmark results

2020-01-07 Thread robert engels
Take a look at https://github.com/golang/go/issues/24735 You probably want to increase benchtime to a larger value, even 10x. > On Jan 7, 2020, at 8:44 PM, Xiangdong JI wrote: > > BTW. 'drop cache' is made, while setting cpu governor is not supported

[go-nuts] Re: How to reduce the fluctuation of micro benchmark results

2020-01-07 Thread Xiangdong JI
BTW. 'drop cache' is made, while setting cpu governor is not supported by the platform. Thanks. On Wednesday, January 8, 2020 at 10:19:25 AM UTC+8, Xiangdong JI wrote: > > Hi, > > Significant fluctuation is observed when running micro benchmarks, even > with the same version of go, e.g the foll

[go-nuts] How to reduce the fluctuation of micro benchmark results

2020-01-07 Thread Xiangdong JI
Hi, Significant fluctuation is observed when running micro benchmarks, even with the same version of go, e.g the following numbers from math/big package, could anyone please share practices that may help generate stable result? FloatAdd/1-64 669ns ± 0% 676ns ± 1%

Re: [go-nuts] Re: A question !

2020-01-07 Thread Motaz Hejaze
Thank you guys for your help, But do to lake of learning resources for golang , i decided flto go for node.js in my startup project , thank you all On Tue, 7 Jan 2020, 5:25 pm Amnon Baron Cohen, wrote: > > > On Tuesday, 7 January 2020 09:44:28 UTC, Motaz Hejaze wrote: >> >> >> May i ask what is

Re: [go-nuts] Re: modules exclude version and above

2020-01-07 Thread 'Bryan C. Mills' via golang-nuts
Ok, I think I've figured out what's going on. The commits tagged `v2.0.2` and `v2.0.3` in this repo have a module in subdirectory `v2` that declares its path to be ` github.com/nicksnyder/go-i18n/v2` . However, that module cannot match the requested path ` g

[go-nuts] Re: regexp syntax and named Unicode character classes

2020-01-07 Thread alan . fox6
As Go's regular expressions are based on RE2, I always use the latter's documentation page to check what is and isn't allowed. Note though that: \C, which RE2 normally allows, isn't allowed in Go. Alan On Tuesday, January 7, 2020 at 6:21:58 PM UTC,

Re: [go-nuts] regexp syntax and named Unicode character classes

2020-01-07 Thread Ian Lance Taylor
On Tue, Jan 7, 2020 at 10:39 AM Tom Payne wrote: > > Thank you :) Is this worth adding to the regexp/syntax documentation? I'd > happily contribute a patch. I think so, if it can be described precisely and tersely. Thanks. Ian > On Tuesday, January 7, 2020 at 7:36:02 PM UTC+1, Ian Lance Tayl

Re: [go-nuts] regexp syntax and named Unicode character classes

2020-01-07 Thread Tom Payne
Thank you :) Is this worth adding to the regexp/syntax documentation? I'd happily contribute a patch. On Tuesday, January 7, 2020 at 7:36:02 PM UTC+1, Ian Lance Taylor wrote: > > On Tue, Jan 7, 2020 at 10:22 AM Tom Payne > > wrote: > > > > tl;dr How should I use named Unicode character classes

Re: [go-nuts] regexp syntax and named Unicode character classes

2020-01-07 Thread Ian Lance Taylor
On Tue, Jan 7, 2020 at 10:22 AM Tom Payne wrote: > > tl;dr How should I use named Unicode character classes in regexps? > > I'm trying to write a regular expression that matches Go identifiers, which > start with a Unicode letter or underscore followed by zero or more Unicode > letters, decimal

[go-nuts] regexp syntax and named Unicode character classes

2020-01-07 Thread Tom Payne
Hi, tl;dr How should I use named Unicode character classes in regexps? I'm trying to write a regular expression that matches Go identifiers , which start with a Unicode letter or underscore followed by zero or more Unicode letters, decimal digits, and/o

Re: [go-nuts] RecvMsgUDP / SendMsgUDP

2020-01-07 Thread John Dreystadt
On Monday, January 6, 2020 at 5:42:04 PM UTC-5, Ian Lance Taylor wrote: > > On Mon, Jan 6, 2020 at 12:46 PM John Dreystadt > wrote: > > > > I noticed that the documentation for net.RecvMesgUDP and net.SendMesgUDP > seemed a bit odd because it referred to “out of band” for some of the > param

Re: [go-nuts] Panicking in public API ?

2020-01-07 Thread Tay
Many thanks everyone for the insight. Instead of accepting a raw query string and try to compile it, I will defer that part to the library user. So, I will simply accept a *sql.Stmt. That way, I won't have to handle the various failure modes within the library and leave the issue to the end user.

Re: [go-nuts] Loading Go plugin from Go shared library ends up with `fatal error: runtime: no plugin module data`

2020-01-07 Thread Ian Lance Taylor
On Tue, Jan 7, 2020 at 7:10 AM Karthik Krishnamurthy wrote: > > I did some more digging on the web and landed on this Go issue where you had > a comment: https://github.com/golang/go/issues/18123#issuecomment-264590075. > > The original issue is related c-archive buildmode, but reading further on

Re: [go-nuts] Re: A question !

2020-01-07 Thread Amnon Baron Cohen
On Tuesday, 7 January 2020 09:44:28 UTC, Motaz Hejaze wrote: > > > May i ask what is the best deployment for more performance ?? > >> >> Do whatever is easiest. If you have come from the Python/Django world then you will be blown away by Go's speed, whatever deployment you use. I would also use

Re: [go-nuts] Loading Go plugin from Go shared library ends up with `fatal error: runtime: no plugin module data`

2020-01-07 Thread Karthik Krishnamurthy
Ian, I did some more digging on the web and landed on this Go issue where you had a comment: https://github.com/golang/go/issues/18123#issuecomment-264590075. The original issue is related c-archive buildmode, but reading further on that thread, I am guessing that even for Go shared libraries

Re: [go-nuts] Re: A question !

2020-01-07 Thread David Riley
On Jan 7, 2020, at 04:44, Motaz Hejaze wrote: > >  > Thank you all guys for your help.. > > May i ask what is the best deployment for more performance ?? I’m not quite sure what you mean. Do you mean what environment results in the highest-performing Go programs? I’d imagine the s390x archite

Re: [go-nuts] Loading Go plugin from Go shared library ends up with `fatal error: runtime: no plugin module data`

2020-01-07 Thread Ian Lance Taylor
On Mon, Jan 6, 2020 at 11:54 PM Karthik Krishnamurthy wrote: > > This is probably an unusual situation, but I am working on a product that has > the following chain of invocation. > > C (native shared library libfoo.so) -> Go (c-shared libbar.so) > > So basically, a native C shared library invoke

AW: [go-nuts] Sybase SQLAnywhere driver for Unix systems

2020-01-07 Thread Lutz Horn
If there is none listed on https://github.com/avelino/awesome-go#database-drivers or https://github.com/golang/go/wiki/SQLDrivers you are out of luck. Lutz Von: golang-nuts@googlegroups.com im Auftrag von reda laanait Gesendet: Dienstag, 7. Januar 202

[go-nuts] Sybase SQLAnywhere driver for Unix systems

2020-01-07 Thread reda laanait
Hello, Is there a Golang driver for Sybase SQLAnywhere DB that works in a Unix system? I only find this , which works only on windows. Otherwise, Is there any workaround to fix that e.g implementing a wrapper of another language driver? Thanks -- LAANAIT A

Re: [go-nuts] Panicking in public API ?

2020-01-07 Thread Brian Candler
On Tuesday, 7 January 2020 07:47:28 UTC, Axel Wagner wrote: > > Personally, I consider panics "run-time type-errors". That is, they > indicate a bug that couldn't be caught statically by the type-system - so > the program shouldn't have compiled in the first place and crashing it is > the right

Re: [go-nuts] doubt about reflect.Type.String and empty interface

2020-01-07 Thread Marvin Renich
* Manlio Perillo [200106 18:57]: > I wrote another test https://play.golang.org/p/hoTAnijCfg1. > Now it is clear why the first entry can only print nil for the type > and for the value. > > However printf %v verb prints nil for both an empty interface and an > interface with a dynamic value of n

[go-nuts] Re: Unlinked temporary files

2020-01-07 Thread Egon
You are not checking return value of os.Remove in https://github.com/eikenb/pipeat/blob/master/pipeat.go#L51. That will fail on windows. You can take look at https://github.com/calebcase/tmpfile, which works on Windows. + Egon On Friday, 3 January 2020 19:50:20 UTC+2, drakk...@gmail.com wrote:

Re: [go-nuts] Panicking in public API ?

2020-01-07 Thread Christian Mauduit
I'd suggest you expose both kind of APIs as in: * https://golang.org/pkg/regexp/#Compile * https://golang.org/pkg/regexp/#MustCompile Implementing the `Must` flavor is trivial, just call the standard func and panic() if you get an error. As a side effect you'll get a unique point where to panic()

Re: [go-nuts] Re: A question !

2020-01-07 Thread Motaz Hejaze
Thank you all guys for your help.. May i ask what is the best deployment for more performance ?? On Mon, 6 Jan 2020, 10:56 am , wrote: > 2 - What is the fastest resource to learn Golang ( efficiently ) >> > > For me the best thing was Effective Go > https://golang.org/doc/effective_go.html > He