Skip to content

goctl VSCode Plugin Adds Extra struct During .api File Formatting #4743

@dwc-dev

Description

@dwc-dev

Description:

When I format .api files with the goctl plugin in VSCode, type definitions within a type() block are incorrectly modified. For example, this:

type (
  TestReq {}
)

gets changed to:

type (
  TestReq struct{}
)

This addition of struct{} causes a syntax error in .api files. The formatting should not modify the type definition in this way.

To Reproduce

  1. Open a .api file in VSCode.
  2. Define a type in a type() block, such as TestReq {}.
  3. Format the file using the goctl plugin.
  4. Notice that TestReq {} is changed to TestReq struct{}, causing a syntax error.

Environments (please complete the following information):

  • OS: [Windows11]
  • go-zero version [1.8.1]
  • goctl version [1.8.1]
  • goctl visual studio code extension [0.1.10]

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