[go-nuts] Re: Using underscore in return statements - a small convenience idea

2023-08-23 Thread Nick Craig-Wood
Ah ha! I thought there would be a related issue I couldn't find :-) `zero` would remove most of the pain though IMHO `_` looks neater in the return statements! Thanks for the pointer Brian. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To un

[go-nuts] Using underscore in return statements - a small convenience idea

2023-08-23 Thread Nick Craig-Wood
// Sometimes you end up typing this having to return // a value you made up but don't care about. func f1() (int, error) { return -1, errors.New("something went wrong") } // Or maybe like this with named return values. func f2() (a int, err error) { return a, errors.New("something went wrong") }

Re: [go-nuts] Re: Making temporary changes to 3rd party modules without breaking go install

2023-02-27 Thread Nick Craig-Wood
This is super annoying - you'll see me in the bug report you linked! The way to work around it is to fork the upstream repo into your own repository, apply the one line patch there, then change all the package lines and go.mod to point to your new repo. After you've done all that then in the

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-27 Thread Craig Silverstein
;d love more insight into the weird linker-time behavior if anyone has it!, but we're not blocked on that anymore. Thanks again for your help. craig -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group an

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-27 Thread Craig Silverstein
ounts for almost all the difference in the test-run times. I don't know what to make of that though. craig On Monday, October 26, 2020 at 10:04:27 PM UTC-7 Ian Lance Taylor wrote: > On Mon, Oct 26, 2020 at 8:46 AM Craig Silverstein > wrote: > > > > > You realiz

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-26 Thread Craig Silverstein
tests are slower. But maybe it does? Or maybe the extra time isn't being spent in building after all. > Also, why not using the "-p" flag if you want it to be parallel? I should have done! craig On Mon, Oct 26, 2020 at 4:16 AM Shulhan wrote: > > > > >

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-25 Thread Craig Silverstein
han all at once. What work is being redone? -- I'd think anything slow would have been cached. craig On Saturday, October 24, 2020 at 8:46:07 AM UTC-7 Shulhan wrote: > > > > On 24 Oct 2020, at 22.21, Craig Silverstein > wrote: > > > >> Client: > &

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-24 Thread Craig Silverstein
lot of work itself, that our tool would need to duplicate -- and it's unclear how practical it is to force it. There may well be better ideas we don't know enough to even think of, though. craig -- You received this message because you are subscribed to the Google Groups "gola

[go-nuts] Distributed go testing (running "go test" as a client)

2020-10-23 Thread Craig Silverstein
pend on go internals. Alternately, if there is some way to reduce the overhead of calling `go test` -- I don't know where all the time is going -- that would be a good solution too. Any ideas/suggestions? Thanks! craig -- You received this message because you are subscribed to the Google Gro

[go-nuts] Re: Considering dropping GO386=387

2020-07-15 Thread Nick Craig-Wood
I make a GO386=387 build for rclone, eg https://github.com/rclone/rclone/issues/437 People love running rclone on ancient computers to rescue data off them I guess. This would affect a very small percentage of users and there are always older versions of rclone they can use so I'm not too both

[go-nuts] Generics and parentheses

2020-07-15 Thread Nick Craig-Wood
In my mind the use of [ ] clashes horribly with the array declaration syntax. When I see [int] in particular my brain says, ah array declaration of size int, what, no wait... This makes [identifier] mean two different things depending on whether indentifier is a const integer or whether identi

Re: [go-nuts] go test -c in go 1.13 does not include -test.timeout flag in binary?

2020-02-05 Thread Craig Rodrigues
On Monday, February 3, 2020 at 11:37:08 AM UTC-8, Ian Lance Taylor wrote: > > On Mon, Feb 3, 2020 at 8:13 AM Craig Rodrigues > wrote: > > > > Regarding the fact that I should not call flag.Parse() from inside an > init() method in my_test.go file, > > if a not

Re: [go-nuts] go test -c in go 1.13 does not include -test.timeout flag in binary?

2020-02-03 Thread Craig Rodrigues
On Friday, January 31, 2020 at 1:56:49 PM UTC-8, Ian Lance Taylor wrote: > > On Fri, Jan 31, 2020 at 10:33 AM Craig Rodrigues > wrote: > > > > Thanks for the response. I have a few questions. > > > > 1. In https://golang.org/pkg/flag/#Parse , would it be a

Re: [go-nuts] go test -c in go 1.13 does not include -test.timeout flag in binary?

2020-01-31 Thread Craig Rodrigues
e docs. 2. To fix my problem, I removed flag.Parse() completely. Is that the appropriate fix? Where would it be appropriate for me to call flag.Parse()? Or should I never bother calling it (inside test files)? 3. Is calling flag.Parse() from inside https://golang.org/pkg/testing/#I

Re: [go-nuts] go test -c in go 1.13 does not include -test.timeout flag in binary?

2020-01-31 Thread Craig Rodrigues
On Thursday, January 30, 2020 at 11:03:04 PM UTC-8, Craig Rodrigues wrote: > > > > On Thursday, January 30, 2020 at 10:06:36 PM UTC-8, Ian Lance Taylor wrote: >> >> On Thu, Jan 30, 2020 at 9:43 PM Craig Rodrigues >> wrote: >> > I see here that this might

Re: [go-nuts] go test -c in go 1.13 does not include -test.timeout flag in binary?

2020-01-30 Thread Craig Rodrigues
On Thursday, January 30, 2020 at 10:06:36 PM UTC-8, Ian Lance Taylor wrote: > > On Thu, Jan 30, 2020 at 9:43 PM Craig Rodrigues > wrote: > > I see here that this might be related: > https://golang.org/doc/go1.13#testing > > > > Testing flags are

[go-nuts] go test -c in go 1.13 does not include -test.timeout flag in binary?

2020-01-30 Thread Craig Rodrigues
result, testing flags are now only registered when running a test binary, and packages that call flag.Parse during package initialization may cause tests to fail. But I'm not sure how to move forward to get back the behavior from go 1.12. Thanks for any help. -- Craig

[go-nuts] Cannot find libraries at go.pedge.io by Peter Edge

2019-09-24 Thread Craig Rodrigues
S for me. Also https://github.com.com/peter-edge does not point to a valid GitHub account. For this particular case where: 1. dependencies were vendored in a few few years ago using govendor 2. I want to convert from govendor to go modules, and rebuild the vendor tree What should I do? --

Re: [go-nuts] Invoke "go test" to execute exactly two specific tests?

2018-10-29 Thread Craig Rodrigues
On Mon, Oct 29, 2018 at 2:18 PM Jan Mercl <0xj...@gmail.com> wrote: > On Mon, Oct 29, 2018 at 10:09 PM Craig Rodrigues > wrote: > > > I can't figure out the regexp to match those two tests exactly. > > For example (not tested) > > $ go test -run '^Test(

Re: [go-nuts] Invoke "go test" to execute exactly two specific tests?

2018-10-29 Thread Craig Rodrigues
On Mon, Oct 29, 2018 at 2:16 PM Burak Serdar wrote: > On Mon, Oct 29, 2018 at 3:09 PM Craig Rodrigues > wrote: > > > > Hi, > > > > I have a suite of 20 tests, each test corresponding to a function: func > Test(). > > > > Out of the 20 tests, I

[go-nuts] Invoke "go test" to execute exactly two specific tests?

2018-10-29 Thread Craig Rodrigues
Hi, I have a suite of 20 tests, each test corresponding to a function: func Test(). Out of the 20 tests, I have two specific tests: func TestXG() func TestNiceSystem() I want to invoke *go test -test.run* to execute exactly those two tests, and nothing else. How can I invoke go test -te

[go-nuts] Re: [ANN] pygor: yet another Python to Go regurgitator

2018-10-20 Thread Nick Craig-Wood
s://groups.google.com/d/msgid/go-python/CANKfucYmWed786-ErNmO-Dyu-zVDSV43AfG17aDoMq1diq9Q9A%40mail.gmail.com?utm_medium=email&utm_source=footer>. For more options, visit https://groups.google.com/d/optout. -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message

[go-nuts] Re: Reset Slice with Make Every Time?

2017-01-09 Thread Craig Donnelly
Quick search of the group would help you out.. https://groups.google.com/d/msg/golang-nuts/KLpMGMmO_xw/m0Lpgd8ZzQQJ On Monday, 9 January 2017 23:12:35 UTC, Tomi Häsä wrote: > > Is this the correct way of resetting a slice? I mean do I always need to > use make to reset a slice? > > // initial

[go-nuts] Re: Why do plugins require a main package?

2016-11-30 Thread Craig Peterson
with exported functions and variables.Fxfunc SomeFunc() {}* > *https://golang.org/ref/spec#Exported_identifiers > <https://golang.org/ref/spec#Exported_identifiers>* > > > Den onsdag den 30. november 2016 kl. 20.13.10 UTC+1 skrev Craig Peterson: >> >> From the 1.8 plugi

Re: [go-nuts] Why do plugins require a main package?

2016-11-30 Thread Craig Peterson
> > > We could arrange for the go tool (probably not the compiler itself) to > optionally auto-generate a main package. Want to write a patch? > > Yes. Yes I do. Not sure exactly where to start, but I will start digging. I will file an issue to track I suppose. -- You received this message

[go-nuts] Why do plugins require a main package?

2016-11-30 Thread Craig Peterson
>From the 1.8 plugin docs : A plugin is a Go main package with exported functions and variables This creates a bit of a headache for me. My current setup is that a plugin is a simple library package like so: package someLibrary import "gihub.com/someapp/pl

Re: [go-nuts] Deleting the /r/golang subreddit

2016-11-28 Thread Craig
I took the same interpretation ("rankist", not sexist). Still an ad hominem. On Mon, Nov 28, 2016 at 9:32 AM Andy Balholm wrote: > I took the usage of “men” in that comment to be gender-neutral. I read it > as “Are you rankist?", not as “Are you sexist or rankist?” > > (I don’t know if rankist is

[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-24 Thread Craig Weber
ially when this forum is widely used by so many in a largely constructive fashion. It's particularly concerning that this proposal wasn't posted to the reddit community even as a courtesy; it's kind of hard to interpret this charitably. Best regards, Craig -- You received this mess

Re: [go-nuts] Slow 64 bit integer division on amd64

2016-11-13 Thread Nick Craig-Wood
> > > > > > -- > Michael T. Jones | Chief Technology Advocate > | m...@google.com | +1 650-335-5765 > > -- > You received this message because you are subscribed to the Google > Groups "golang-nuts&q

Re: [go-nuts] What are the consequences of go install -ldflags "-s"

2016-11-04 Thread Nick Craig-Wood
On 04/11/16 14:55, Ian Lance Taylor wrote: > On Fri, Nov 4, 2016 at 7:39 AM, Nick Craig-Wood wrote: >> I know I can build go binaries passing the `-s` flag to the linker to >> strip them and make them smaller. In my tests (with rclone) it makes it >> 60% of the size so a si

[go-nuts] What are the consequences of go install -ldflags "-s"

2016-11-04 Thread Nick Craig-Wood
Why wouldn't I want to do this? Any insight much appreciated. -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- 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] Architect a daemon program

2016-10-12 Thread Nick Craig-Wood
named as`myprog`) to fork into the background > (if possible) with the "start" command-line option. You could try this https://github.com/sevlyar/go-daemon This implements the daemonization by re-running the executable with an environment variable. -- Nick Craig-Wood -- http:/

Re: [go-nuts] Slow compile times

2016-10-04 Thread Nick Craig-Wood
> go install github.com/coreos/pkg/capnslog > > > But this does not help me here. Has anybody an idea to fix this 'issue'? try `go test -i` to install the dependencies for the test. -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message bec

Re: [go-nuts] file or folder encryption tool

2016-09-19 Thread Nick Craig-Wood
uff. -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- 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 golang-nuts+unsubscr...@googlegroups.com.

[go-nuts] Copying http.DefaultTransport

2016-09-14 Thread Nick Craig-Wood
https://play.golang.org/p/l2mkCTZSzL Is there a better way? Should making an http.Transport with the default settings in be something the standard library should support? Maybe a NewDefaultTransport() function? -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message becaus

Re: [go-nuts] Speeding up Go Report Card

2016-09-05 Thread Nick Craig-Wood
process-in-linux So I'd check to see if you are running out of threads, or memory because of lots of threads. > The server we run this on is a Digital Ocean droplet with 1 GB of RAM > (would upgrading it help?) > > We normally only see issues on repositories with a very large numbe

Re: [go-nuts] tbsp - Spoon-feed your table-based tests!

2016-08-25 Thread Nick Craig-Wood
already something out there like this - I totally > missed that subtests were coming in 1.7 until I saw the release notes, > so I'm playing catchup. Could you do a backwards compatibility mode so it would work in go 1.5 and 1.6? If so that would be really useful! -- Nick Craig-Wood -- h

Re: [go-nuts] Get all attributes with zero value using reflection

2016-08-03 Thread Nick Craig-Wood
Interface() { aField.Set(bField) } } } I won't attempt to modify it to do exactly what you asked as that would require reading the reflect docs again ;-) -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message because you are subscribed

Re: [go-nuts] Handling dynamic and unknown number of wait groups?

2016-06-30 Thread Nick Craig-Wood
I forgot to add - don't call `wg.Add(1)` inside the go routine - it is racy! If you are trying to start a pool of go routines, you can find that none of them get scheduled before you run the wg.Wait(). -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message be

Re: [go-nuts] Handling dynamic and unknown number of wait groups?

2016-06-30 Thread Nick Craig-Wood
ally do this well > in Go. > > Cheers, > > Inspectre > > -- > 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 golang-nut

Re: [go-nuts] How to hide command line argument from ps

2016-06-23 Thread Nick Craig-Wood
ey are only user readable, which means root or another process running as the same user could read them. -- Nick Craig-Wood -- http://www.craig-wood.com/nick -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from thi