Package custom domain

Hi all.

When I Create custom domain for my package like this

<meta name="go-import" content="code.gyt.is/writefreely git https://github.com/gytisrepecka/writefreely" />
<meta name="go-source" content="code.gyt.is/writefreely https://github.com/gytisrepecka/writefreely https://github.com/gytisrepecka/writefreely/tree/master{/dir} https://github.com/gytisrepecka/writefreely/blob/master{/dir}/{file}#L{line}" />

then I try go get in new project I have some error like this

go get code.gyt.is/writefreely                                                                                                                                                  ─╯
go: downloading code.gyt.is/writefreely v0.0.1
go: code.gyt.is/writefreely@v0.0.1: verifying module: code.gyt.is/writefreely@v0.0.1: reading https://goproxy.cn/sumdb/sum.golang.org/lookup/code.gyt.is/writefreely@v0.0.1: 404 Not Found
        server response:
        not found: code.gyt.is/writefreely@v0.0.1: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/68810a2e811d4b05ff603d5d5704409f3cd5eacd82dd5d2038f869ef899160dc: exit status 128:
                fatal: could not read Username for 'https://gitlab.com': terminal prompts disabled
        Confirm the import path was entered correctly.
        If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

what wrong with my configuration
Please help
Thanks

Hi @Rusli_Nasir,

Two observations:

  1. The first error I see is a 404 not found when quering the Chinese Go sum database:

The subsequent error message reveals that the Go sum DB at goproxy.cn tries to access gitlab.com:

I have no idea why the proxy fiddles with GitLab when the import path resolves to GitHub. But in any case, v0.0.1 does not seem to exist anyway. (I tried go get code.gyt.is/writefreely@v0.0.1 and got an invalid version error.) MAYBE try a different Go proxy.

  1. When I run the go get command, I get a different error (for a different version):
> go get code.gyt.is/writefreely                                                                                                                                                       0s
go: downloading code.gyt.is/writefreely v0.13.2
go: code.gyt.is/writefreely@upgrade (v0.13.2) requires code.gyt.is/writefreely@v0.13.2: parsing go.mod:
	module declares its path as: github.com/writefreely/writefreely
	        but was required as: code.gyt.is/writefreely

This one should be easy to fix: Replace the module path in your go.mod file with the vanity import path:

module code.gyt.is/writefreely

You might need to bump the version after that change, in order to update the proxy.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.