Reputation: 2964
I've been trying to create and publish a golang SDK for my web application: https://datelist.io Everything works well on my local setup. However, things are started to get more difficult once I'd like to publish my SDK to the https://pkg.go.dev/ website
The code I'd like to publish is available there: github.com/datelist/datelist-sdk-golang
I've read a few tutorials, and, if I understand correctly, all I needed was to:
I've tried different ways to index my changes, and, according to that link: https://go.dev/about/ Once solution is to visit that page: https://proxy.golang.org/MYMODULE_PATH
I've thus tried: https://proxy.golang.org/github.com/datelist/datelist-sdk-golang/@v/v1.0.0.info
However, I've got the following error:
not found: github.com/datelist/[email protected]: invalid version: unknown revision v1.0.0
I've tried different things. I've published two tags on my github repository: v1.0.0 and 1.0.0 and it doesn't work. I've checked: my code looks valid, and the version seems to exist, as I can go to: https://proxy.golang.org/github.com/datelist/datelist-sdk-golang/@v/ce18fa0756c2.info However, I'm stuck when it comes to adding my SDK to go.dev
Thanks in advance
Upvotes: 6
Views: 1835
Reputation: 22027
Your go.mod (latest commit ce18fa
) module name is incorrect (/v1.0.0
is not needed):
module github.com/datelist/datelist-sdk-golang/v1.0.0
the go.mod at git release tag v1.0.0
points to an import path datelist.io/sdk
that does not exist:
module datelist.io/sdk
Update your go.mod
to this (valid URL - with no tag suffix):
module github.com/datelist/datelist-sdk-golang
go 1.16
and then git tag this committed release as say v1.0.1
- and that should make your module work.
Consumers of your library can then:
go get github.com/datelist/datelist-sdk-golang
or explicitly:
go get github.com/datelist/[email protected]
The former implicitly chooses the latest semver
version via git tags - v1.0.1
in this case.
Upvotes: 2