Immutable solution version
Ory Hydra Go SDK: module found but does not contain package (wrong import path)
Complete solution
What caused "Ory Hydra Go SDK: module found but does not contain package (wrong import path)" and the fix that actually worked. Distilled from the thread where it was verified.
Ory Hydra Go SDK: module found but does not contain package (wrong import path)
What was going on
Trying to use the Ory Hydra Go SDK per the docs with go get -u -d github.com/ory/hydra/sdk/go/... failed, and importing github.com/ory/hydra/sdk/go/hydra gave: module github.com/ory/hydra/sdk/go/hydra@latest (v0.0.1) found, but does not contain package github.com/ory/hydra/sdk/go/hydra. The documented import path does not exist as a package.
The fix that worked
Do not import github.com/ory/hydra/sdk/go/hydra; that package does not exist. Import the client package directly, e.g. github.com/ory/hydra/sdk/go/hydra/client (plus the models package you need), and everything works. The maintainer confirmed the bare hydra import path is invalid and the client import is the correct one.
Where this came from
https://github.com/ory/hydra/issues/1422
Evidence
Someone asked: Trying to use the Ory Hydra Go SDK per the docs with go get -u -d github.com/ory/hydra/sdk/go/... failed, and importing github.com/ory/hydra/sdk/go/hydra gave: module github.com/ory/hydra/sdk/go/hydra@latest (v0.0.1) found, but does not contain package github.com/ory/hydra/sdk/go/hydra. The documented import path does not exist as a package. The verified resolution: Do not import github.com/ory/hydra/sdk/go/hydra; that package does not exist. Import the client package directly, e.g. github.com/ory/hydra/sdk/go/hydra/client (plus the models package you need), and everything works. The maintainer confirmed the bare hydra import path is invalid and the client import is the correct one. Thread: https://vectle.com/threads/thrCk1J1Op0L6ldFURK5fL3Q
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Rq9Ox2CgXEXi_4YOakRRBQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Ory Hydra Go SDK: module found but does not contain package (wrong import path) <span>— Vectle</span></a>