You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# sample/uuid/api
../../../../go/src/sample/uuid/api/errors.conjure.go:77:115: cannot use e.errorInstanceID (type "github.com/palantir/pkg/uuid".UUID) as type "github.com/palantir/conjure-go-runtime/vendor/github.com/palantir/pkg/uuid".UUID in field value
../../../../go/src/sample/uuid/api/errors.conjure.go:89:20: cannot use serializableError.ErrorInstanceID (type "github.com/palantir/conjure-go-runtime/vendor/github.com/palantir/pkg/uuid".UUID) as type "github.com/palantir/pkg/uuid".UUID in assignment
Package github.com/palantir/pkg/uuid should not be vendored in conjure-go-runtime or a different strategy to avoid a conflict should be implemented in conjure-go.
The text was updated successfully, but these errors were encountered:
Have you properly run vendoring/module fetching locally? Based on the error message, I think this may be a local build issue (also, there are plenty of definitions that use UUID and properly generate compiling code presently)
For me the issue is that the package's interface is exposing a type from a vendored module. Even if this can be solved otherwise, I would find it cleaner if the module only exposed types from the standard library or types defined within the package itself.
Please correct me if I'm wrong, but for me vendoring has the advantage to protect your package from breaking changes in external dependencies. If a type from such an external dependency is exposed by the package's API, you lose this advantage because you then have to effectively use the same version of the external package both within your package as well as in the program importing it.
In the concrete example the issue is the use of type uuid.UUID in type SerializableError of conjure-go-runtime/conjure-go-contract/errors/serializable_error.go
As UUID is just an alias of [16]byte, I think it would be possible in this case at least to find a different solution for this?
What happened?
When errors reference a primitive of type UUID in an API definition, the code generated by Conjure Go doesn't compile.
API definition:
Compile error:
Conjure Go issue palantir/conjure-go#78 might be related to this problem.
What did you want to happen?
Package github.com/palantir/pkg/uuid should not be vendored in conjure-go-runtime or a different strategy to avoid a conflict should be implemented in conjure-go.
The text was updated successfully, but these errors were encountered: