Re: [go-nuts] some incorrect code in blog.

2021-11-27 Thread Brian Candler
On Saturday, 27 November 2021 at 07:55:10 UTC tapi...@gmail.com wrote: > Isn't the code should be: > > *func CopyFile() {* > * ...* > * if err != nil {* > * return* > * }* > > * defer func() { err = src.Close() }()* > * ...* > *}* > No. Note that the signature of this function (fr

Re: [go-nuts] some incorrect code in blog.

2021-11-27 Thread 'Axel Wagner' via golang-nuts
On Sat, Nov 27, 2021 at 11:03 AM Brian Candler wrote: > Whether (1) or (2) applies depends whether the final return is a "naked" > one or not. In this case it isn't: > > > *return io.Copy(dst, src)* > > Therefore, the value returned is whatever io.Copy() returns > That is not true

Re: [go-nuts] some incorrect code in blog.

2021-11-27 Thread Brian Candler
Ergh. Thank you for putting me right. That is definitely a good reason for avoiding *named* return values completely. -- 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 emai

[go-nuts] SFTPGo 2.2.0 released

2021-11-27 Thread Nicola Murino
Hi all, I'm pleased to announce SFTPGo 2.2.0! SFTPGo is a fully featured and highly configurable SFTP server with optional HTTP, FTP/S and WebDAV support, written in Go. It can serve local filesystem, S3 (compatible) Object Storage, Google Cloud Storage, Azure Blob Storage, other SFTP servers.

[go-nuts] grpc and golang struct tags

2021-11-27 Thread Sankar
Hi I have a database that has a column `2xxCode`. This database is part of a legacy system and I cannot make changes to this, as there are multiple applications that depend on this, and some of the applications are unchangeable. Now I want to create a new gRPC server in golang that has to inte

[go-nuts] How to vary cgo lib path by os?

2021-11-27 Thread David Karr
I'm aware of the "build constraints" mechanism, which lets individual files be only compiled on specific oses or architectures. I am constructing an app that has a single cgo module, which is the "meat" of the application (longest module). In my poc, the cgo header specifies a lib path with "li

Re: [go-nuts] How to vary cgo lib path by os?

2021-11-27 Thread Ian Lance Taylor
On Sat, Nov 27, 2021 at 11:01 AM David Karr wrote: > > I'm aware of the "build constraints" mechanism, which lets individual files > be only compiled on specific oses or architectures. > > I am constructing an app that has a single cgo module, which is the "meat" of > the application (longest mo

Re: [go-nuts] How to vary cgo lib path by os?

2021-11-27 Thread David Karr
On Sat, Nov 27, 2021 at 11:57 AM Ian Lance Taylor wrote: > On Sat, Nov 27, 2021 at 11:01 AM David Karr > wrote: > > > > I'm aware of the "build constraints" mechanism, which lets individual > files be only compiled on specific oses or architectures. > > > > I am constructing an app that has a si

Re: [go-nuts] How to vary cgo lib path by os?

2021-11-27 Thread David Karr
On Saturday, November 27, 2021 at 1:13:12 PM UTC-8 David Karr wrote: > On Sat, Nov 27, 2021 at 11:57 AM Ian Lance Taylor > wrote: > >> On Sat, Nov 27, 2021 at 11:01 AM David Karr >> wrote: >> > >> > I'm aware of the "build constraints" mechanism, which lets individual >> files be only compile