changwei
V2EX  ›  问与答

gogland 如何使函数参数为非字面量的时候也能正确显示对应参数名?

  •  
  •   changwei · Sep 26, 2017 · 1496 views
    This topic created in 3177 days ago, the information mentioned may be changed or developed.

    https://sfault-image.b0.upaiyun.com/377/151/3771513274-59c93aed2ee9f

    gogland 如何使函数参数为非字面量的时候也能正确显示对应参数名?

    比如说下图这种情况,当函数参数为一个变量的时候,他前面就不会显示一个灰色的参数名,但是如果是字面量就会直接显示,我怎么让他在所有情况下都显示?

    3 replies    2017-09-26 10:01:51 +08:00
    ikaros
        1
    ikaros  
       Sep 26, 2017
    不是你说的原因,你试试把后面的 + err.Error() 去掉那个参数名就出来了

    怎么设置我也不知道
    ikaros
        2
    ikaros  
       Sep 26, 2017
    好奇怪为啥你想看那个参数的名, 一般不是更在意类型的吗? 我都是关掉那个参数名提示的
    feiyuanqiu
        3
    feiyuanqiu  
       Sep 26, 2017
    打开设置:Editor > General > Appearance: Show parameter name hints [configure]
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1080 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:21 · PVG 07:21 · LAX 16:21 · JFK 19:21
    ♥ Do have faith in what you're doing.