[GODRIVER-543] Enable support for Go 1.11 modules Created: 06/Sep/18  Updated: 28/Oct/23  Resolved: 03/Feb/20

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.3.0

Type: Improvement Priority: Major - P3
Reporter: Kristofer Brandow (Inactive) Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by GODRIVER-855 when to support install by go module Closed

 Description   

Turn the Go driver into a Go 1.11 module so it can be used with the Go module system. Follow this instructions found here: https://github.com/golang/go/wiki/Modules#how-to-define-a-module.



 Comments   
Comment by Githook User [ 04/Feb/20 ]

Author:

{'name': 'Divjot Arora', 'username': 'divjotarora', 'email': 'divjot.arora@10gen.com'}

Message: GODRIVER-543 Change README to recommend modules (#292)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/5fc229a98558a384f6551756dce7119285fde6f2

Comment by Githook User [ 03/Feb/20 ]

Author:

{'username': 'iwysiu', 'name': 'iwysiu', 'email': 'isabella.siu@10gen.com'}

Message: GODRIVER-543 enable modules (#288)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/4313e32a1a175d89d19560657192acabb8c0072c

Comment by Pierre Durand [ 19/Jun/19 ]

Currently it's working fine for me.

I can use v1.0.3 without any issue.

Of course it would be better to have a go.mod file.

Comment by Jeffrey Yemin [ 26/Sep/18 ]

Reference: https://github.com/golang/go/wiki/Modules

Which notes:

Modules are capable of consuming packages that have not yet opted into modules.

A user, however, has reported this error:

Before this makes it beta, is this package going to be fixed up to work with go modules? At the moment using the alpha-14 it is not possible to use.

For example:

github.com/mongodb/mongo-go-driver/core/connstring imports github.com/mongodb/mongo-go-driver/internal which is disallowed.

Following error:
unknown import path "github.com/mongodb/mongo-go-driver/internal": cannot find module providing package github.com/mongodb/mongo-go-driver/internal

Generated at Thu Feb 08 08:34:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.