go-modules

malformed module path “xxxx/xxxx/uuid” missing dot in first path element when migrating from GOPATH based dep to go mod

*爱你&永不变心* 提交于 2020-01-20 08:01:46
问题 $ go version 1.13.3 I have a folder structure as follows: GOPATH +---src +--- my-api-server +--- my-auth-server +--- main.go +--- my-utils +--- uuid +--- uuid.go my-auth-server uses my-api-server/my-utils/uuid as a depenency Now, when I used the GOPATH based module system, this worked fine. But when using go modules, when I run go run main.go in my-auth-server it returned error: build command-line-arguments: cannot load my-api-server/my-utils/uuid: malformed module path "my-api-server/my

malformed module path “xxxx/xxxx/uuid” missing dot in first path element when migrating from GOPATH based dep to go mod

半城伤御伤魂 提交于 2020-01-20 08:01:41
问题 $ go version 1.13.3 I have a folder structure as follows: GOPATH +---src +--- my-api-server +--- my-auth-server +--- main.go +--- my-utils +--- uuid +--- uuid.go my-auth-server uses my-api-server/my-utils/uuid as a depenency Now, when I used the GOPATH based module system, this worked fine. But when using go modules, when I run go run main.go in my-auth-server it returned error: build command-line-arguments: cannot load my-api-server/my-utils/uuid: malformed module path "my-api-server/my

malformed module path “xxxx/xxxx/uuid” missing dot in first path element when migrating from GOPATH based dep to go mod

﹥>﹥吖頭↗ 提交于 2020-01-20 08:01:25
问题 $ go version 1.13.3 I have a folder structure as follows: GOPATH +---src +--- my-api-server +--- my-auth-server +--- main.go +--- my-utils +--- uuid +--- uuid.go my-auth-server uses my-api-server/my-utils/uuid as a depenency Now, when I used the GOPATH based module system, this worked fine. But when using go modules, when I run go run main.go in my-auth-server it returned error: build command-line-arguments: cannot load my-api-server/my-utils/uuid: malformed module path "my-api-server/my

go.mod changes in travis-ci

只谈情不闲聊 提交于 2020-01-15 05:55:31
问题 I have upgraded my project to use go 1.11.2 modules support. However, I am running into a very annoying problem. The go.mod file keeps changing in CI. It is a different file each day. Today the lines in go.sum is: golang.org/x/net v0.0.0-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= The go.mod is: golang.org/x/net v0.0.0-20190213061140-3a22650c66bd //

Go Modules does not recognize files under GOPATH

穿精又带淫゛_ 提交于 2019-12-26 16:02:26
问题 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 doing wrong? Below is a screenshot. Left pic: GoModules, which doesnt recognize the package. Right Pic: Simple GO project, which recognized the packages. I tried doing sync package, with no luck. Go version - 1.12.3 . 回答1: The two supported modes ("GOPATH mode" and "module-aware mode") are mutually

Error when trying to deploy Google cloud function in Go 1.11 using go modules

岁酱吖の 提交于 2019-12-23 09:31:18
问题 I am having issues trying to deploy a Google cloud function in Go 1.11 using Go modules. I have have the following code structure in my GOPATH : └── example ├── models │ ├── go.mod │ └── models.go └── load ├── fn.go ├── go.mod ├── go.sum └── vendor └── .... the load/go.mod looks like the following: module github.com/example/load require ( github.com/example/models v0.0.0 ) replace github.com/example/models => ../models When I try to deploy the function using the command gcloud functions

go build keeps complaining that: go.mod has post-v0 module path

南楼画角 提交于 2019-12-22 03:15:54
问题 Following the release of Go 1.11, I have been trying to move my repositories to Go modules, by adding a go.mod file at their root. One of my root libraries my.host/root is in its version 17.0.1, so I wrote in its go.mod file: module my.host/root/v17 I tagged that version v17.0.1 as documented in the Go modules manual. When I try to make a new Go project that uses my root library, like: package main import root "my.host/root/v17" func main() { root.DoSomething() } And try to compile it, I get

What incompatible in go.mod mean, will it make harm?

僤鯓⒐⒋嵵緔 提交于 2019-12-18 13:35:31
问题 I'm using goczmq in my project, something like next: main.go: package main import ( _ "github.com/zeromq/goczmq" ) func main() { } And more, I'm using golang 1.12 with gomod to manage my project. See next, I use go mod init xxx , and when build, it downloads goczmq automatically for me and add dependency to go.mod , but has incompatible in it. (But for other library I may get something like github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181 ) go.mod: module pigeon go 1.12 require (

How to use a module that is outside of “GOPATH” in another module?

强颜欢笑 提交于 2019-12-11 11:18:34
问题 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 module? OS: Windows 7 , Go: v1.11 回答1: The easiest and working out-of-the-box solution is to put your database package / module into a VCS (e.g. github.com), so other packages (inside other modules) can simply refer to it by importing it like: import "github.com/someone/database" If you do so, you

go.mod has post-v0 module path “git.example.com/owner/repo/v3” at revision …?

大兔子大兔子 提交于 2019-12-11 04:08:57
问题 My coworker pushed a tag v3.0.1 before updating go.mod to have /v3 suffix (https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher). I have updated module path ( go.mod ) and all import paths ( *.go ) to fix it, tagged as v3.0.2 . Now the problem is: go get -v git.example.com/owner/repo@v3.0.2 go: finding git.example.com/owner/repo v3.0.2 go: git.example.com/owner/repo@v0.0.0-20190722053407-d85c4f69ad17: go.mod has post-v0 module path "git.example.com/owner/repo/v3" at