douyan4900 2019-03-27 15:06
浏览 12
已采纳

gofmt可以容纳本地编码标准首选项吗?

I love the role that gofmt has in Go programming. We would rather, though, that the following:

func somefunc(
    a *sometype, // Explanation of a
    b int, // Explanation of b
    longName float64, // Explanation of longName
) {
...

be able to be formatted like:

func somefunc(
    a        *sometype, // Explanation of a
    b        int,       // Explanation of b
    longName float64,   // Explanation of longName
) {
...

similar to how structs are formatted, and keeping with our coding standards for other languages. Is there any provision for accommodating local preferences like these, or is this "not the way we do things around here"? I couldn't find any access to the patterns that gofmt uses, so my guess is "no".

  • 写回答

1条回答 默认 最新

  • dqy27359 2019-03-27 15:14
    关注

    Can Go accommodate local coding standard preferences?

    No. You guessed correctly.

    (The whole reason for a standard is to have one, instead of one per person/organization.)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分合并
  • ¥20 pcf8563时钟芯片不启振
  • ¥20 pip2.40更新pip2.43时报错
  • ¥15 换yum源但仍然用不了httpd