go-modules Questions

1

Why do individual module versions sometimes need 2 lines in go.sum? one line is just for the module version (v0.1.1 in the example below) one line also has /go.mod tacked onto the version (v0.1.1/...
Moiety asked 3/9, 2020 at 10:41

5

Solved

I am trying out Go modules. My project requires the libarary golang.org/x/net/html, so I defined this go.mod file: module github.com/patrickbucher/prettyprint require golang.org/x/net/html And ...
Byway asked 9/9, 2018 at 6:53

2

Solved

I got a github repo github.com/user/somerepo. I init it by doing go mod init **github.com/user/somerepo** I need to change this dependecy and make it point to another github repository. Let say ...
Demonism asked 7/6, 2020 at 8:57

2

Solved

I have two go modules github.com/myuser/mymainrepo and github.com/myuser/commonrepo Here is how i have the files in my local computer - allmyrepos - mymainrepo - Dockerfile - go.mod - commonre...
Taster asked 7/5, 2020 at 12:24

2

Solved

I was trying to set up GO Modules in intellij and was trying import a package under GOPATH. When I use Go Modules, it doesnt seem to 'import' the packages from GOPATH. Any ideas on what I could be ...
Improvvisatore asked 12/4, 2019 at 11:17

2

I'm pretty new to golang and docker so after looking around in many threads and internet resources I ended up confused about how I should set things up. My problem is that I'm facing a docker buil...
Scapular asked 30/12, 2019 at 12:10

2

Solved

I have two Go modules, let's name them example.com/a and example.com/b. Let this be example.com/a's go.mod: module example.com/a go 1.12 require ( example.com/b v0.4.2 ) In example.com/b's root...
Thorfinn asked 22/4, 2021 at 10:56

2

Solved

I have a Go module named mymodule, and I'd like to rename it into github.com/hylowaker/awesome-module Using command go mod edit -module github.com/hylowaker/awesome-module only changes module name...
Stereotomy asked 11/2, 2020 at 9:20

1

I recently started using Go. I installed go's extension on vscode and I can use some commands like go run and go build but when I run go test I get the following error: go: cannot find main module...
Faires asked 7/3, 2021 at 15:29

1

Solved

I am getting a weird error when I am trying to build my go code. $ make install go version go1.16 windows/amd64 bin/check_go_version 1.14.4 plugin/loader/preload.sh > plugin/loader/preload.go go...
Jerz asked 4/3, 2021 at 5:57

7

Solved

I'm using go modules as dependency management, and I'm having problem to install something like this: go get -u github.com/go-critic/go-critic/... the result from above was: go: cannot find mai...
Winburn asked 19/11, 2018 at 4:9

1

Given a project in Golang (1.14+) which is using test dependencies (like github.com/stretchr/testify) and now assume this project is a public library which can be used by others. Usually when I now...
Bellda asked 25/9, 2020 at 21:9

3

We have a private code repository accessible only through ssh/git (no https), and we would like to host our go code/modules there. First I tried: git config --global url."[email protected...
Marnie asked 28/8, 2020 at 8:1

1

Solved

I am using Go modules. In order to use module version, I cannot use local module. For example: replace locakpkg => ../localpkg v0.1.0 The above will fail because replacement local path cannot h...
Moran asked 27/1, 2021 at 15:9

3

Solved

I'm using Go modules in my project and in my build system (e.g. Travis CI) I'm downloading a command-line utility (written in Go) with go get to assist with my build process, e.g.: go get github.c...
Zillion asked 1/7, 2019 at 20:57

1

Solved

How can I identify the import path of a module that exists in go.sum but not in go.mod? I'd like to know which module in go.mod is importing the module listed in go.sum, and the entire chain betwee...
Tinstone asked 12/1, 2021 at 12:16

2

Solved

I want to put all my models in a shared Common lib. So, I made a new repo: gitlab.com/xxx/common Inside I put a package: models Here is the definition of an object: type Meter struct { ID str...
Weather asked 19/7, 2019 at 10:1

2

Solved

I have a go package located on my filesystem (not in the $GOPATH), called bitbucket.org/me/awesome. ~/awesome> tree . ├── main.go ├── go.mod ├── go.sum ├── subpackageA │   └── main.go My go....
Giaour asked 18/11, 2018 at 21:50

2

I used export GO111MODULE=on when i type go get -u github.com/swaggo/swag/cmd/swag I got go get: disabled by -mod=vendor so i can't use the go get any more, anyone who can help me? and my go en...
Nicholle asked 22/10, 2019 at 3:5

2

Solved

I've created a library as the module for personal use outside of "GOPATH" in "database" folder with this command "go mod init database," and I don't know: How to use/import this module in another...
Gutsy asked 14/9, 2018 at 9:28

4

Solved

I'm using go 1.11 with module support. I understand that the go tool now installs dependencies automatically on build/install. I also understand the reasoning. I'm using docker to build my binarie...
Koralie asked 10/9, 2018 at 22:29

1

Solved

I want to list the modules (and their versions) that are compiled in the final executable (and not other dependencies). I can do that with: $ go build -o a.out $ go version -m a.out But how can I ...
Untoward asked 15/10, 2020 at 12:21

1

Solved

I'm trying to connect to my local Kubernetes cluster hosted on minikube, here's the code for the same, now when I do go run minikube.go, it gives me an error saying: ../../../pkg/mod/k8s.io/[email&...

2

I read everywhere that packages have to have a tag of v0 or v1. Why can't a tag be v2020 or something other than v0 or v1. I have tried this personal and is get the following error with I use v2020...
Miliaria asked 1/6, 2020 at 20:54

1

I'm writing two binaries, and both of them use two libraries (we can call them libA and libB). Each lib is in a dedicated git repo, with git-tags to declare versions. For example, libA is at v1.0....
Bumgardner asked 25/5, 2020 at 19:19

© 2022 - 2024 — McMap. All rights reserved.