8000 how to configure arithmetic formatting? · Issue #6 · mbenkmann/goformat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
how to configure arithmetic formatting? #6
Open
@mcandre

Description

@mcandre

Hi,

I am seeking alternatives to gofmt with better arithmetic styling. Sadly, gofmt and some other implementations use inconsistent spacing around arithmetic operators. Specifically, gofmt and friends try too hard to be helpful, bunching up multiplicative expressions without spaces, but then re-expanding them when a formula has no other mathematical operations.

gofmt does this crap:

y := 2*x + 1
z := 2 * x

When it should really pick:

y := 2 * x + 1
z := 2 * x

for readability.

What is a goformat configuration, preferably a text file, to force a single ASCII space on both sides of arithmetic and binary operators, other than negation (!)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0