Skip to content

Empty lines inside structs/functions are sometimes removed #65

@horenmar

Description

@horenmar

I have a source file that uses cgo a lot, and running it through dst causes (some) empty lines in structs/functions to be removed.

I tried some testing, and I am not entirely sure what causes the empty lines to be removed, because e.g. this struct is left alone

type StructTest struct {
	aaa int32

	b int32
}

but a similar struct

type AType struct {
	c      *C.StructNameCensored
	f SomeComplexGoType

	using int32
}

has the empty line removed, so it looks like this:

type AType struct {
	c     *C.StructNameCensored
	f     SomeComplexGoType
	using int32
}

I also have a similar issue inside (some) functions -- I guess this is related to the C APIs? However, the newline between the package line and the copyright notice is also removed:

// Copyright 2020 Pexeso Inc. All Rights reserved.

package matcher

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