[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

[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

[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

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

2018-10-20 Thread Nick Craig-Wood
.google.com/d/msgid/go-python/CANKfucYmWed786-ErNmO-Dyu-zVDSV43AfG17aDoMq1diq9Q9A%40mail.gmail.com?utm_medium=email_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 because yo

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 <n...@craig-wood.com> 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

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 <n...@crai

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 <n...@craig-wood.com> -- http://www.craig-wood.com/nick -- You received t

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

2016-09-19 Thread Nick Craig-Wood
-- Nick Craig-Wood <n...@craig-wood.com> -- 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+uns

[go-nuts] Copying http.DefaultTransport

2016-09-14 Thread Nick Craig-Wood
://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 <n...@craig-wood.com> -- http://www.craig-wood.com/nick -- You re

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

2016-09-05 Thread Nick Craig-Wood
-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 number of > files

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

2016-06-30 Thread Nick Craig-Wood
o actually 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-n