fix: parse config issues

This commit is contained in:
Hiddify
2024-08-06 22:45:01 -04:00
parent b389963aa8
commit f31899c269
6 changed files with 9 additions and 4 deletions

View File

@@ -87,7 +87,7 @@ func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error) {
}
Log(pb.LogLevel_DEBUG, pb.LogType_CORE, "Parsing Config")
parsedContent, err := parseConfig(content)
parsedContent, err := readOptions(content)
Log(pb.LogLevel_DEBUG, pb.LogType_CORE, "Parsed")
if err != nil {
@@ -247,7 +247,7 @@ func generateConfigFromFile(path string, configOpt config.ConfigOptions) (string
if err != nil {
return "", err
}
options, err := parseConfig(string(content))
options, err := readOptions(string(content))
if err != nil {
return "", err
}

View File

@@ -81,7 +81,7 @@ func NewService(options option.Options) (*libbox.BoxService, error) {
return &service, nil
}
func parseConfig(configContent string) (option.Options, error) {
func readOptions(configContent string) (option.Options, error) {
var options option.Options
err := options.UnmarshalJSON([]byte(configContent))
if err != nil {