Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unrecognized import path "cloud.google.com/go" #2415

Closed
rinyshen opened this issue Apr 22, 2019 · 7 comments · Fixed by #2429
Closed

unrecognized import path "cloud.google.com/go" #2415

rinyshen opened this issue Apr 22, 2019 · 7 comments · Fixed by #2429

Comments

@rinyshen
Copy link

Your issue may already be reported! Please search on the issue track before creating one.

What version of Go are you using (go version)?

Which database and its version are you using?

Please provide a complete runnable program to reproduce your issue. IMPORTANT

Need to runnable with GORM's docker compose config or please provides your config.

package main

import (
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mssql"
	_ "github.com/jinzhu/gorm/dialects/mysql"
	_ "github.com/jinzhu/gorm/dialects/postgres"
	_ "github.com/jinzhu/gorm/dialects/sqlite"
)

var db *gorm.DB

func init() {
	var err error
	db, err = gorm.Open("sqlite3", "test.db")
	// db, err = gorm.Open("postgres", "user=gorm password=gorm DB.name=gorm port=9920 sslmode=disable")
	// db, err = gorm.Open("mysql", "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True")
	// db, err = gorm.Open("mssql", "sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm")
	if err != nil {
		panic(err)
	}
	db.LogMode(true)
}

func main() {
	if /* failure condition */ {
		fmt.Println("failed")
	} else {
		fmt.Println("success")
	}
}
@emirb
Copy link
Contributor

emirb commented Apr 22, 2019

Hi @rinyshen. You might be missing a ca-certificates package. What version of Go are you using, and which OS?

Similar issue was reported directly on Google's repository: googleapis/google-cloud-go#820

@rinyshen
Copy link
Author

Hi @emirb ,the version of Go are 1.12,My project can not compile and I have replaced this package,
Do I need to install ca-certificates packages?

@rinyshen
Copy link
Author

@emirb I use the "go module" management tool, but when i executed "go mod tidy" command, i get the error, How can i solve it?

@emirb
Copy link
Contributor

emirb commented Apr 23, 2019

Can you paste the output of:
go get -v -u cloud.google.com/go

@rinyshen
Copy link
Author

Hi @emirb , I execute the command,like this:

go get: upgrading golang.org/x/crypto@v0.0.0-20190325154230-a5d413f7728c: unrecognized import path "golang.org/x/crypto" (https fetch: Get https://golang.org/x/crypto?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
go: cloud.google.com/go@v0.37.2: unrecognized import path "cloud.google.com/go" (https fetch: Get https://cloud.google.com/go?go-get=1: dial tcp 216.58.200.78:443: i/o timeout)
go: cloud.google.com/go@v0.37.4: unrecognized import path "cloud.google.com/go" (https fetch: Get https://cloud.google.com/go?go-get=1: dial tcp 216.58.200.78:443: i/o timeout)
go get: upgrading golang.org/x/sys@v0.0.0-20190215142949-d0b11bdaac8a: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
go get: error loading module requirements

@emirb
Copy link
Contributor

emirb commented Apr 28, 2019

I presume you're doing this inside some container. Do you have ca-certificates installed?

The output should be

go get -v -u cloud.google.com/go


Fetching https://cloud.google.com/go?go-get=1
Parsing meta tags from https://cloud.google.com/go?go-get=1 (status code 200)
get "cloud.google.com/go": found meta tag get.metaImport{Prefix:"cloud.google.com/go", VCS:"git", RepoRoot:"https://code.googlesource.com/gocloud"} at https://cloud.google.com/go?go-get=1
Fetching https://golang.org/x/exp?go-get=1
Fetching https://go.opencensus.io?go-get=1
Fetching https://golang.org/x/tools?go-get=1
Fetching https://golang.org/x/time?go-get=1
Fetching https://honnef.co/go/tools?go-get=1
...

@emirb emirb mentioned this issue Apr 30, 2019
3 tasks
@emirb
Copy link
Contributor

emirb commented Apr 30, 2019

Thanks, fixed in #2428 and tagged as v1.9.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants