go-modules Questions

3

Solved

I have a small module that contains some shared code. The module looks like the following : Shared ├── go.mod ├── go.sum ├── logging │ └── logger.go └── db-utils ├── db.go If I'll try to build th...
Tropho asked 22/6, 2021 at 8:24

4

I installed Golang and faced with go.mod file not found in current directory or any parent directory error at very first time. But I'm working on <GOPATH>/src directory. Isn't go.mod only req...
Cozza asked 11/6, 2021 at 0:21

2

Solved

I have installed my project's Go module dependencies with go build. But GoLand is telling me it cannot resolve any of these dependencies. How can I get GoLand to find the Go module dependencies? ...
Ament asked 10/5, 2019 at 11:14

4

I am trying to import local modules, but I am unable to import it using go mod. I initially built my project using go mod init github.com/AP/Ch2-GOMS Note my environment is go1.14 and I am using VS...
Berseem asked 14/3, 2020 at 6:56

2

Solved

Consider the following setup: go.mod module example.com/main require example.com/sub dummy replace example.com/sub => ./sub sub/go.mod module example.com/sub If I run go mod tidy in the ma...
Laveralavergne asked 1/1, 2022 at 2:25

2

Solved

Imagine I have a repo github.com/user/golang-examples and I provision to version each example module within it separately: guthub.com/user/golang-examples /modA /go.mod /pkgA1 /pkgA2 /modB /...
Waldon asked 5/11, 2020 at 16:15

2

Solved

What is proper way to import (use) go module internally? For example: creating a new module by: go mod init example.com/my-project (example.com or another domain, which doesn't exist) and using...
Amnion asked 13/5, 2019 at 17:46

1

Solved

I'm learning Go with the specialization Programming with Google Go. It has several courses, each of which has several modules. My project looks like the following (made with https://ascii-tree-gene...
Conjoined asked 6/12, 2021 at 8:41

2

Solved

When I open my Goland project, the following command is run: /usr/local/Cellar/go/1.14/libexec/bin/go list -m -json all #gosetup Its output is the following error: go list -m: can't compute 'al...
Avionics asked 26/2, 2020 at 12:14

1

Solved

I've been going though a set of projects, dealing with updating dependencies and there is one thing I don't have a clear answer to and that is why the generated sum file lists so many older version...
Immingle asked 3/11, 2021 at 13:16

2

My environment is go1.17.2 Windows AMD64 with go env GO111MODULE=on. I add import "github.com/go-redis/redis/v8" in my code. I execute go install github.com/go-redis/redis/v8@latest, but ...
Aloin asked 10/11, 2021 at 3:2

2

I'm trying to get a specific package from github for a project. However, when I use go get [url] or go mod vendor, I get a git fetch error for lack of permissions to one of my company's repos. This...
Nancynandor asked 23/7, 2020 at 4:9

1

Solved

I'm trying to import a module located in AWS codecommit. To clone the repository I'm using HTTPS GRC (Git Remote Codecommit) method, which uses Google Suite credentials to access AWS console. The c...
Volotta asked 21/10, 2021 at 18:37

2

Solved

Is there a way to use a shorter name representation/mapping in modules? I have a project, with an url naming: module github.com/<org>/<project> go 1.14 Would be nice to be able to ...
Ungodly asked 24/4, 2020 at 9:20

2

I am attempting to create named loggers automatically for HTTP handlers that I'm writing, where I am passed a function (pointer). I'm using the code mentioned in this question to get the name of a ...
Angeles asked 5/10, 2021 at 19:7

1

Solved

I've created a small go application. Few days back I've upgraded from go 1.15 to 1.17 and I've also upgraded packages with go get -u. After the changes I have 2 require blocks in my go.mod file. Wh...
Crisis asked 4/10, 2021 at 8:16

4

Solved

ATTENTION this question is about Go language specs not best practice or recommendation. I have read many articles of packages but I still don't quite understand the relationship of directory and pa...
Misprision asked 30/6, 2020 at 8:39

1

Solved

Today I upgraded to Go 1.17. The release notes at https://golang.org/doc/go1.17 talk about this new feature: Module authors may deprecate a module by adding a // Deprecated: comment to go.mod I k...
Astera asked 29/8, 2021 at 20:7

1

Solved

In Go 1.17 go.mod has two sections, direct dependencies and indirect dependencies, however, there is no indication how indirect dependencies are related to direct dependencies. How can I find out f...
Flytrap asked 25/8, 2021 at 11:12

4

I'm trying to deploy a golang app based on gin framework using bitbucket pipeline and AWS Elastic Beanstalk. I create my package application.zip with all the files needed to deploy the app inside a...
Tintinnabulation asked 2/12, 2019 at 17:42

2

Solved

I have a project with mutliple main methods. When running go build program1/main1.go which has a different set of dependencies than program2/main2.go, my first go build seems to alter my go.mod fil...
Qp asked 11/2, 2019 at 12:4

1

Solved

If I understand correctly, go install puts binaries in $GOBIN directory. I tend to forget which packages provide which binaries in $GOBIN and which packages I go install-ed. Is there a way to list ...
Simmer asked 16/7, 2021 at 13:0

3

When I run go mod tidy, it breaks because a package imported by my project imports another package using path github.com/coreos/bbolt, but when it fetches the package from this path its go.mod says...
Phonic asked 25/3, 2021 at 5:23

1

Suppose I have a monorepo and there are several individual golang services: root └── services ├── svc1 │   ├── go.mod │   ├── go.sum │   └── main.go └── svc2 ├── go.mod ├── go.sum └── main...
Helbonia asked 23/4, 2021 at 5:1

1

Setup: Our project is using golang 1.12.14 We are using go build -mod=vendor Issue: When new dependencies are added to go.mod the vendor folder isn't updated and people are committing code an...
Stultz asked 30/4, 2020 at 19:23

© 2022 - 2024 — McMap. All rights reserved.