go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

goctl generate code duplicate in import part

Open alexanyang opened this issue 1 year ago • 0 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior, if applicable:

  1. The code is

      import (
     "net/http"
    
     "book/service/user/api/internal/logic"
     "book/service/user/api/internal/svc"
     "book/service/user/api/internal/types"
     "github.com/zeromicro/go-zero/rest/httpx"
    
     "github.com/zeromicro/go-zero/rest/httpx"
     )
    
    
  2. The error is

      "github.com/zeromicro/go-zero/rest/httpx" // duplicate
    

Expected behavior no duplicated import

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

Environments (please complete the following information):

  • OS: [mac os 11.5.2]
  • go-zero version [ 1.3.5]
  • goctl version [1.3.5, optional]
  • may be other version is still with this question

More description Just do like :https://go-zero.dev/cn/docs/quick-start/micro-service It will appear in /internal/handler

alexanyang avatar Aug 02 '22 10:08 alexanyang

Fixed in v1.4.0

kevwan avatar Aug 18 '22 00:08 kevwan