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

import "github.com/robfig/cron/v3" failed #267

Closed
MirkoWu opened this issue Dec 15, 2019 · 9 comments
Closed

import "github.com/robfig/cron/v3" failed #267

MirkoWu opened this issue Dec 15, 2019 · 9 comments

Comments

@MirkoWu
Copy link

@MirkoWu MirkoWu commented Dec 15, 2019

go: downloading github.com/robfig/cron/v3 v3.0.0
go: downloading github.com/robfig/cron v1.2.0
verifying github.com/robfig/cron/v3@v3.0.0: github.com/robfig/cron/v3@v3.0.0: Get https://sum.golang.org/lookup/github.com/robfig/cron/v3@v3.0.0: dial tcp 172.217.24.17:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

@robfig
Copy link
Owner

@robfig robfig commented Jan 4, 2020

What version of Go are you using? Are you still having a problem?

@luthfikw
Copy link

@luthfikw luthfikw commented Jan 6, 2020

same issues, but different message

go version go1.12.9 darwin/amd64

$ go get github.com/robfig/cron/v3@v3.0.0
go: github.com/robfig/cron@v0.0.0-20200104010508-ccba498c397b: go.mod has post-v0 module path "github.com/robfig/cron/v3" at revision ccba498c397b
go: error loading module requirements

@dragstor
Copy link

@dragstor dragstor commented Jan 6, 2020

Use "gopkg.in/robfig/cron.v3" for imports.
Also,

go get gopkg.in/robfig/cron.v3 in term.

@luthfikw
Copy link

@luthfikw luthfikw commented Jan 7, 2020

@dragstor when i used gopkg.in
at go mod tidy, just download and forget that

go version go1.12.9 darwin/amd64

Screen Shot 2020-01-07 at 10 41 23

@dragstor
Copy link

@dragstor dragstor commented Jan 8, 2020

@dragstor when i used gopkg.in
at go mod tidy, just download and forget that

go version go1.12.9 darwin/amd64

Screen Shot 2020-01-07 at 10 41 23

I don't get it - you managed to import it or not?

@robfig
Copy link
Owner

@robfig robfig commented Jan 9, 2020

I do not believe that Go Modules works with gopkg.in, because Go Modules requires that you import the module using the canonical import path.

I believe you have to import it like this:

import "github.com/robfig/cron/v3"

It works for me:

$ go mod init test.com/m
go: creating new go.mod: module test.com/m

$  go get github.com/robfig/cron/v3@v3.0.1
go: finding github.com v3.0.1
go: finding github.com/robfig v3.0.1
go: finding github.com/robfig/cron/v3 v3.0.1
go: finding github.com/robfig/cron v3.0.1
go: downloading github.com/robfig/cron/v3 v3.0.1
go: extracting github.com/robfig/cron/v3 v3.0.1

@luthfikw
Copy link

@luthfikw luthfikw commented Jan 9, 2020

I do not believe that Go Modules works with gopkg.in, because Go Modules requires that you import the module using the canonical import path.

I believe you have to import it like this:

import "github.com/robfig/cron/v3"

It works for me:

$ go mod init test.com/m
go: creating new go.mod: module test.com/m

$  go get github.com/robfig/cron/v3@v3.0.1
go: finding github.com v3.0.1
go: finding github.com/robfig v3.0.1
go: finding github.com/robfig/cron/v3 v3.0.1
go: finding github.com/robfig/cron v3.0.1
go: downloading github.com/robfig/cron/v3 v3.0.1
go: extracting github.com/robfig/cron/v3 v3.0.1

working well with this,
i think gopkg.in working well on go13.xx

@robfig robfig closed this Feb 29, 2020
@denghuancong
Copy link

@denghuancong denghuancong commented May 7, 2020

try many methods , it not works, how difficult to use.
GO version 1.13, GO11MODULE=on

import "github.com/robfig/cron/v3"
go: git.xx.com/xx/schedule imports
        gopkg.in/robfig/cron.v3: gopkg.in/robfig/cron.v3@v3.0.1: parsing go.mod:
        module declares its path as: github.com/robfig/cron/v3
                but was required as: gopkg.in/robfig/cron.v3

@robfig
Copy link
Owner

@robfig robfig commented May 7, 2020

The error message says what's wrong:

go: git.xx.com/xx/schedule imports
        gopkg.in/robfig/cron.v3:

Your package imports "gopkg.in/robfig/cron.v3".

Instead, it should import "github.com/robfig/cron/v3"

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

Successfully merging a pull request may close this issue.

None yet
5 participants