Questions tagged [go-modules]

A module is a collection of related Go packages. Modules are the unit of source code interchange and versioning. The go command has direct support for working with modules, including recording and resolving dependencies on other modules. Modules replace the old GOPATH-based approach to specifying which source files are used in a given build.

The Go Module concept was first published by Russ Cox here: Defining Go Modules.

Module support first appeared in Go 1.11 (in preliminary phase).

The go tool has built-in and extensive support for modules, documentation can be found at Go tool: Module maintenance and at Modules, module versions, and more. The command go help mod also provides sufficient details.

570 questions
0
votes
2 answers

Golang Cloud Function failed deployment missing dot in first path element

I tried to deploy Golang Project with module = mymodule, but failed with below error Deployment failure: Build failed:…
iwan
  • 7,269
  • 18
  • 48
  • 66
0
votes
0 answers

Conflicting type in golang compilation

I am including a library "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/typed/k8s.cni.cncf.io/v1" in kubernetes source code, this is for internal purpose (kubernetes devs will not like it) while…
nmathew
  • 3
  • 3
0
votes
1 answer

Getting go module issue

I'm new to go modules, I'd like to https://github.com/microsoft/ApplicationInsights-Go but can't import it using go modules, all the other packages are automatically imported, just this one doesn't want :/ What am I missing? package logger import…
sziszu
  • 490
  • 1
  • 6
  • 16
0
votes
2 answers

Importing Go modules from a different repository in the same file system

I have two separate Go repositories. One contains an application, another a shared library that the application would like to use. Neither are in $GOPATH. ~/projects/ ├── myapplication │   ├── go.mod │   └── myapplication.go └── mylibrary ├──…
user1741222
0
votes
1 answer

Go mod issue for go-linq package

I am trying to implement the go mod dependency management for my project. I have run command go mod init then go.mod file is created after that execute the go build command. It give me following error. gopkg.in/ahmetb/go-linq.v3:…
0
votes
1 answer

Issue with using a modified version of a Go dependency

So here is the situation: I have a fork of go-ipfs. It depends on go-ipfs-config. I need to modify go-ipfs-config and make go-ipfs depend on my modified version. I forked the go-ipfs-config made my changes and made sure to update the path to be that…
dade
  • 3,340
  • 4
  • 32
  • 53
0
votes
1 answer

version of golang.org/x/sys@hash in go.mod ignored

I am trying to use github.com/docker/engine as a dependency for dockmoor, however, there were breaking changes in x/sys/windows and so compiling for windows is not working…
Mene
  • 3,739
  • 21
  • 40
0
votes
1 answer

GoLand not detecting vendor packages under $GOPATH/pkg/mod?

Goland not detecting the imported modules from github.com. The modules are available in $GOPATH/pkg/mod directory but the imports are not being resolved. The vendor directory also have all the packages downloaded. Goland Version : 2019.3.3 Go…
0
votes
1 answer

Golang gqlgen error trying to import model into resolver.go

Hello I was playing arround with Golang and wanted to try GraphQL instead of a RESTful approach. So I decided to use https://github.com/99designs/gqlgen to implement it. I followed to getting started guide and everything went fine until I pasted the…
Solesins
  • 11
  • 2
  • 7
0
votes
1 answer

How can go module only download package in a subdirectory of a repository?

I created a module named A and push it to my company's private repo. The repo's address is xxx.com/inf/client.git and A module is a sub directory so A module is named as xxx.com/inf/client.git/A When I'm using the module, I import it in my code…
Aaron
  • 461
  • 6
  • 17
0
votes
1 answer

go get -u github.com/onsi/ginkgo/ginkgo starts throwing error all of a sudden

When I run go get -u github.com/onsi/ginkgo/ginkgo till yesterday I had no issues. Specifically with fsnotify the output was like below 00:52:08 go: downloading gopkg.in/fsnotify.v1 v1.4.7 00:52:08 go: extracting gopkg.in/tomb.v1…
ambikanair
  • 4,004
  • 11
  • 43
  • 83
0
votes
3 answers

Right way to get dependencies from private repository

I have private bitbucket repo on http://localhost:7990 clone link http://localhost:7990/scm/gom/bar.git go.mod looks like: module mod.org/bar go 1.13 References available in a remote repository: git ls-remote http://localhost:7990/scm/gom/bar.git…
kozmo
  • 4,024
  • 3
  • 30
  • 48
0
votes
2 answers

Not able to get private go module while having port number in url

What version of Go are you using (go version)? go1.14 windows/amd64 Does this issue reproduce with the latest release? Yes What did you do? $ go get -u bitbucket.mycompany.com:8443/test/go-lib What did you expect to see? download the go-lib…
王子1986
  • 3,019
  • 4
  • 31
  • 43
0
votes
1 answer

Can I update go mod dependence package without adding a new tag for the dependence package

I have two code repository A and B in Go, A depends on B using gomod management. For example, the latest tag version of B is v1.0.1 and the same version in A's go.mod, and then some new commits are merged into B, but without upgrade tag. Can I get…
0
votes
2 answers

Error when trying to deploy Google Cloud function with Vendor directory

I tried with go113 and go111 but none of them works: Directory structure looks like: cool_project - func.go - func_test.go utility - helper.go fancy - fancy.go go.mod # module cool_project go.sum .gcloudignore …