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

builder.go:20:65: cannot use url.Endpoint (value of type func() string) as type string in array or slice literal

Open adil-ly opened this issue 2 years ago • 2 comments

在拉取外部包编译项目时报错 A clear and concise description of what the bug is. 在/zrcc/registry/consul/builder.go中的20行 To Reproduce Steps to reproduce the behavior, if applicable:

  1. The code is

    
    ```dsn := strings.Join([]string{schemeName + ":/", url.Authority, url.Endpoint}, "/")
    
    
  2. The error is

    url.Endpoint调用会导致cannot use url.Endpoint (value of type func() string) as type string in array or slice literal错误
    
    应该将url.Endpoint  改为 url.Endpoint()方法调用
    
    

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

Screenshots image

Environments (please complete the following information):

  • OS: [e.g. Linux]
  • go-zero version [e.g. 1.2.1]
  • goctl version [e.g. 1.2.1, optional]

More description Add any other context about the problem here.

adil-ly avatar Mar 03 '23 02:03 adil-ly

引用的包不是最新的? go get -u在试试

MaxToby avatar Oct 30 '23 14:10 MaxToby

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The referenced package is not up to date? go get -u trying it now

Issues-translate-bot avatar Oct 30 '23 14:10 Issues-translate-bot