Conversation
|
这种移除后要加个报错 |
|
嗯 好像言出法随不小心改炸了 再看看 |
ray本身的机制一直是无视多余的选项 当然额外加一个检测到某个字段就panic也行 个人觉得不是很有必要 本来这就是个没人用的功能 可能有的老旧工具或者config会有这个字段但是不会加入有意义内容 那样就误杀了 |
|
有人用了曾经有过的功能必须要报错退出,或者你可以写成这个字段里有实际内容才报错 |
那还得保留这个build((( |
|
我记得可以用个 json raw 啥的结构接收,然后再作分析,判断有没有任何内容 |
5e9fc48 to
2bdfadc
Compare
|
json.RawMessage |
没耍过 晚上有时间看下吧 |
@mmmray |
|
|
infra/conf/transport.go
Outdated
| @@ -22,84 +20,9 @@ type TransportConfig struct { | |||
| func (c *TransportConfig) Build() (*global.Config, error) { | |||
There was a problem hiding this comment.
it seems like this function is never called. I deleted this entire file and replaced TransportConfig with json.RawValue, and it compiled fine
There was a problem hiding this comment.
it seems like this function is never called. I deleted this entire file and replaced
TransportConfigwithjson.RawValue, and it compiled fine
可以
|
@mmmray 要不使用非指针?现在这种写法,如果仅有这个字段但里面没任何内容也会报错吧?我觉得要防止
|
|
How about this then? I don't really know what the old tools do, but if it's |
对,测试了吗 |
|
|
我觉得可以release之后看反馈多不多再说 |
|
直接 json.RawMessage 的话,内容包不包括外面的 |
|
This is tested: The configs Things like All of them are "not meaningful", I don't know which one exists in practice |
transport
|
@mmmray 你把这个 commit 改成作者为你,Co-authored-by @Fangliding 吧 |
#3751 (comment) Co-authored-by: 风扇滑翔翼 <[email protected]>
#3751 (comment) --------- Co-authored-by: 风扇滑翔翼 <[email protected]>
XTLS#3751 (comment) --------- Co-authored-by: 风扇滑翔翼 <[email protected]>
尝试移除全局TransportConfig 本来以为会有点史不过还是挺干净的 代码里分的很明显叫TransportConfig和StreamConfig 也只在处理config时候作用没影响别的part