[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

[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

[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

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