How to use thrifter.ToJSON() function

111 views
Skip to first unread message

Vaishnavi Singh

unread,
Jun 8, 2022, 2:35:14 PM6/8/22
to golang-nuts
Hi all!

I'm working on a project in golang, where I have to convert a thrift string into json. I came across thrifter package. thrift-iterator.   
Please help me write 
1) How to import?
2) Import external dependencies using bazel
3) Also, does thrifter.ToJSON recursively includes other thrift files from the given thrift file.
like:
xyz.thrift file:
namespace
include"abc.thrift"
-
-

Will abc will also be included when converting xyz.thrift file into json, while using thrift.ToJSON.

If there exist some another method to convert thrift into json in golang please let me know.
Please help. Thanks a lot

jake...@gmail.com

unread,
Jun 9, 2022, 12:06:41 PM6/9/22
to golang-nuts
From your first question, it appears that you have never used Go before. I would start with the intro tutorial: A Tour of Go. Other resources and tutorials on the official documentation page might also be helpful.

I would also note that the thrift-iterator source is not being actively maintained, as the last change was 4 years ago. It also does not appear to have a go.mod file, which is now more-or less required. So you may need to fork it and add one.
Reply all
Reply to author
Forward
0 new messages