thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yuxuan Wang (Jira)" <>
Subject [jira] [Commented] (THRIFT-4685) Support the new golang modules (1.11 or later)
Date Wed, 09 Dec 2020 17:09:00 GMT


Yuxuan Wang commented on THRIFT-4685:

[~slon] Thanks. I understood the situation.

If the only problem is that your codebase needs to import 2 different versions of thrift library,
one from your dependency and one for yourself, one +workaround+ you can do is to use [""|]
for the one for yourself. You can pass the thrift_import flag to thrift compiler to make sure
that thrift compiled go file also use this import path:

thrift_import=   Override thrift package import path (

Of course that's just a workaround. It won't work if you actually need 3 or more versions
to co-exist, might disappear/sunset in the future, etc.. But have
you tried that? Although go's toolchain allows you to have 2 versions of the same library
to co-exist as long as they have different import paths, in reality consider thrift's unique
case of compiler get mixed in, I suspect that you will actually face other issues causing
them to not able to co-exist at all. If "" from your
dependency and "" from your other code cannot really
co-exist in your project, then "" (or maybe "",
I haven't tried to see which is actually accepted by go toolchain) won't co-exist either,
so changing the major version won't really help your case.

> Support the new golang modules (1.11 or later)
> ----------------------------------------------
>                 Key: THRIFT-4685
>                 URL:
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Go - Library
>    Affects Versions: 0.12.0
>         Environment: golang 1.11 or later
>            Reporter: James E. King III
>            Assignee: Duru Can Celasun
>            Priority: Minor
> Go added new module support in 1.11, see:
> We should move towards it.

This message was sent by Atlassian Jira

View raw message