Skip to content

Running gofumpt on a gofumpted file adds an extra space #345

@sheki

Description

@sheki

I have a situation when I run gofumpt on a file (proto generated) it adds an extra whitespace on the second run of gofumpt on the same file.
Expected behavior would be do nothing.

--- cost2.go    2025-11-17 16:53:59
+++ cost3.go    2025-11-17 16:54:25
@@ -135,6 +135,7 @@
                (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp
        }
 )
+
 var file_server_models_appdb_costs_proto_depIdxs = []int32{
        1, // 0: appdb.CostsPoint.timestamp:type_name -> google.protobuf.Timestamp
        1, // [1:1] is the sub-list for method output_type

To reproduce run gofumpt on this file and then run gofumpt again on the output file.
Expect the second gofumpt to return no diff but it adds a whitespace
cost1.txt

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