Skip to content

goctl model mysql datasource 生成 Model 代码多引用依赖问题 #3825

Closed
@calvinit

Description

@calvinit

Describe the bug

如果不生成带缓存的代码,xxx_model_gen.go 不应该 import 进来 "github.com/zeromicro/go-zero/core/stores/sqlc" 依赖!

To Reproduce

  1. The code is

    goctl model mysql datasource --url 'xxx' -t '*' --style go_zero -d model
  2. The error is

    Error: Unused import "github.com/zeromicro/go-zero/core/stores/sqlc"
    

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environments (please complete the following information):

  • OS: MacOS Sonoma 14.2.1
  • go-zero version 1.6.1
  • goctl version 1.6.1 darwin/amd64

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