Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Is there any way to exclude a specific file or specific parts of a file? #157

@CyborgMaster

Description

@CyborgMaster

We have a file that is improperly reformed by golines. Specifically it changes this struct tag:

string typeGen `codegen:"name=String,type=string,zero=\"\",noError=true"`

into this one:

string typeGen `codegen:"name=String,type=string,zero="",noError=true"`

Which is flagged by govet with "struct field tag codegen:"name=String,type=string,zero="",noError=true" not compatible with reflect.StructTag.Get: key:"value" pairs not separated by spaces (govet)"

I would like to be able to instruct golines to ignore this file, like we have with the --ignored-dirs option, or to ignore this part of the file with some bounding comments.

Of course it would be great to fix the invalid struct tag reformatting, but I'm confident that there will be other parts of our codebase we would like to surgically ignore, at a finer grained level than directories, so having an option to do that would be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions