[Libguestfs] [PATCH nbdkit] golang: Add go.mod files, remove use of $GOPATH.
Daniel P. Berrangé
berrange at redhat.com
Thu Apr 1 14:38:29 UTC 2021
On Thu, Apr 01, 2021 at 03:31:35PM +0100, Richard W.M. Jones wrote:
> golang 1.16 defaults to this, and 1.17 will require it:
> https://blog.golang.org/go116-module-changes
>
> Fixes: https://aur.archlinux.org/packages/nbdkit/
> Thanks: Svenne Krap
> ---
> plugins/golang/Makefile.am | 9 +++++----
> plugins/golang/examples/disk/go.mod | 4 ++++
> plugins/golang/examples/dump-plugin/go.mod | 4 ++++
> plugins/golang/examples/minimal/go.mod | 4 ++++
> plugins/golang/examples/ramdisk/go.mod | 4 ++++
> plugins/golang/src/libguestfs.org/nbdkit/go.mod | 4 ++++
> 6 files changed, 25 insertions(+), 4 deletions(-)
> diff --git a/plugins/golang/examples/disk/go.mod b/plugins/golang/examples/disk/go.mod
> new file mode 100644
> index 00000000..b55533c8
> --- /dev/null
> +++ b/plugins/golang/examples/disk/go.mod
> @@ -0,0 +1,4 @@
> +module main
> +
> +replace libguestfs.org/nbdkit => ../../src/libguestfs.org/nbdkit
> +require libguestfs.org/nbdkit v1.0.0
This is needed because the nbdkit opackage is in a different
part of the directory subtree from this dir.
If desired, you can avoid needing these per-example go.mod
files by moving the src/libguestfs.org/nbdkit files into a
direct ancestor directory of the examples.
Either approach works though, and neither is inherantly bad
or wrong, so pick your favourite, and on that basis
Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the Libguestfs
mailing list