Ehco1996 / ehco

ehco is a network ʚrelayɞ tool and a typo :)
https://docs.ehco-relay.cc/
GNU General Public License v3.0
1.2k stars 208 forks source link

refactor(internal/constant): add RelayType #348

Closed ioogle closed 1 week ago

ioogle commented 2 weeks ago

Issue: https://github.com/Ehco1996/ehco/issues/345

ioogle commented 2 weeks ago

Since relay types can be specified via the command line, the validateType() function cannot be eliminated. However, it is best practice to use a self-defined type.

Ehco1996 commented 1 week ago

@ioogle thanks for your pr, but ci failed, could your please check and fix these errors?

Error: internal/transporter/ws.go:35:25: cannot use cfg.TransportType (variable of type "github.com/Ehco1996/ehco/internal/constant".RelayType) as string value in argument to zap.S().Named (typecheck)

By the way, you can execute make lint and make test commands to check if your patch can pass the CI tests