You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Yuxuan Wang (Jira)" <ji...@apache.org> on 2021/03/25 18:25:00 UTC

[jira] [Commented] (THRIFT-5378) Generated Go enums' always appear to be in debuggers

    [ https://issues.apache.org/jira/browse/THRIFT-5378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17308887#comment-17308887 ] 

Yuxuan Wang commented on THRIFT-5378:
-------------------------------------

The PR you made generated essentially the same go code, so you must have some other issue caused the problem. Can you provide a minimal example with detailed steps (for example, which version of which debugger are you using and on which platform) to reproduce the issue?

> Generated Go enums' always appear to be <UNSET> in debuggers
> ------------------------------------------------------------
>
>                 Key: THRIFT-5378
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5378
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Go - Compiler
>            Reporter: Alan Cabrera
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, the generated Go enums' {{String()}} method returns "<UNSET>", when its value is unknown, by the return statement at the end of the function.  For reasons unknown to me, this causes all enums in my debugger to have the value "<UNSET>", even though they do have a proper value.
> If I move the return statement up into a default case of the switch statement, everything seems to display perfectly in the debugger.  It's a simple enough fix and I will submit a patch today.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)