mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-02-26 19:23:14 +03:00
Chore: Fix tests (#4440)
This commit is contained in:
parent
ce2384cccc
commit
d451078e72
@ -89,12 +89,11 @@ func whichProtoc(suffix, targetedVersion string) (string, error) {
|
||||
|
||||
path, err := exec.LookPath(protoc)
|
||||
if err != nil {
|
||||
errStr := fmt.Sprintf(`
|
||||
return "", fmt.Errorf(`
|
||||
Command "%s" not found.
|
||||
Make sure that %s is in your system path or current path.
|
||||
Download %s v%s or later from https://github.com/protocolbuffers/protobuf/releases
|
||||
`, protoc, protoc, protoc, targetedVersion)
|
||||
return "", fmt.Errorf(errStr)
|
||||
}
|
||||
return path, nil
|
||||
}
|
||||
|
@ -50,17 +50,17 @@ func executeTypedMessageToJson(cmd *base.Command, args []string) {
|
||||
|
||||
reader, err := confloader.LoadConfig(cmd.Flag.Arg(0))
|
||||
if err != nil {
|
||||
base.Fatalf(err.Error())
|
||||
base.Fatalf("failed to load config: %s", err)
|
||||
}
|
||||
|
||||
b, err := io.ReadAll(reader)
|
||||
if err != nil {
|
||||
base.Fatalf(err.Error())
|
||||
base.Fatalf("failed to read config: %s", err)
|
||||
}
|
||||
|
||||
tm := cserial.TypedMessage{}
|
||||
if err = json.Unmarshal(b, &tm); err != nil {
|
||||
base.Fatalf(err.Error())
|
||||
base.Fatalf("failed to unmarshal config: %s", err)
|
||||
}
|
||||
|
||||
if j, ok := creflect.MarshalToJson(&tm, injectTypeInfo); ok {
|
||||
|
@ -53,12 +53,12 @@ func executeConvertConfigsToProtobuf(cmd *base.Command, args []string) {
|
||||
}
|
||||
|
||||
if len(unnamedArgs) < 1 {
|
||||
base.Fatalf("empty config list")
|
||||
base.Fatalf("invalid config list length: %d", len(unnamedArgs))
|
||||
}
|
||||
|
||||
pbConfig, err := core.LoadConfig("auto", unnamedArgs)
|
||||
if err != nil {
|
||||
base.Fatalf(err.Error())
|
||||
base.Fatalf("failed to load config: %s", err)
|
||||
}
|
||||
|
||||
if optDump {
|
||||
|
Loading…
x
Reference in New Issue
Block a user