e-chip / redis-rwlock

Golang implementation of distributed RW-Lock (Writer-preferring) using Redis.
MIT License
20 stars 6 forks source link

Failed to import by go module #4

Closed jonas0616 closed 4 years ago

jonas0616 commented 4 years ago

When running go build in my project, following error is shown:

go: finding github.com/e-chip/redis-rwlock latest
go: downloading github.com/e-chip/redis-rwlock v0.0.0-20191030182710-122e3f7ba621
build xxx: cannot load github.com/e-chip/redis-rwlock/v1: cannot find module providing package github.com/e-chip/redis-rwlock/v1

Failed to run go get with go module:

$ go get github.com/e-chip/redis-rwlock/v1
go: finding github.com/e-chip/redis-rwlock latest
go: downloading github.com/e-chip/redis-rwlock v0.0.0-20191030182710-122e3f7ba621
go get github.com/e-chip/redis-rwlock/v1: go.mod has post-v0 module path "github.com/e-chip/redis-rwlock/v1" at revision 122e3f7ba621

After reexamine with the go module documentation. There is a statement in the section of Semantic Import Versioning:

If the module is version v0 or v1, do not include the major version in either the module path or the import path.

Furthermore, the semver VCS tag is also required if you would like to support to get specific version by semver. (What happens if I create a go.mod but do not apply semver tags to my repository?)

e-chip commented 4 years ago

Thanks for noting this!

e-chip commented 4 years ago

I've just checked, this does not seems to work.

e-chip commented 4 years ago

I forgot to move release tag after removing v1 from module name... Now it should be fine.