From aadd8fdd89c05d4536e725ab664d62b4972b8b31 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Apr 2026 14:43:44 +0800 Subject: [PATCH] style: apply gofmt formatting --- sub/subClashService.go | 2 +- sub/subController.go | 4 +- web/service/setting.go | 124 ++++++++++++++++++++--------------------- 3 files changed, 65 insertions(+), 65 deletions(-) diff --git a/sub/subClashService.go b/sub/subClashService.go index bc5f46f4..517869f1 100644 --- a/sub/subClashService.go +++ b/sub/subClashService.go @@ -13,7 +13,7 @@ import ( // SubClashService handles Clash YAML subscription generation. type SubClashService struct { - template string + template string inboundService service.InboundService SubService *SubService } diff --git a/sub/subController.go b/sub/subController.go index 94c26a60..fc3316da 100644 --- a/sub/subController.go +++ b/sub/subController.go @@ -25,8 +25,8 @@ type SUBController struct { subEncrypt bool updateInterval string - clashEnabled bool - subClashPath string + clashEnabled bool + subClashPath string subService *SubService subJsonService *SubJsonService diff --git a/web/service/setting.go b/web/service/setting.go index 208496e6..ccd684a6 100644 --- a/web/service/setting.go +++ b/web/service/setting.go @@ -28,59 +28,59 @@ import ( var xrayTemplateConfig string var defaultValueMap = map[string]string{ - "xrayTemplateConfig": xrayTemplateConfig, - "webListen": "", - "webDomain": "", - "webPort": "2053", - "webCertFile": "", - "webKeyFile": "", - "secret": random.Seq(32), - "webBasePath": "/", - "sessionMaxAge": "360", - "pageSize": "25", - "expireDiff": "0", - "trafficDiff": "0", - "remarkModel": "-ieo", - "timeLocation": "Local", - "tgBotEnable": "false", - "tgBotToken": "", - "tgBotProxy": "", - "tgBotAPIServer": "", - "tgBotChatId": "", - "tgRunTime": "@daily", - "tgBotBackup": "false", - "tgBotLoginNotify": "true", - "tgCpu": "80", - "tgLang": "en-US", - "twoFactorEnable": "false", - "twoFactorToken": "", - "subEnable": "true", - "subJsonEnable": "false", - "subTitle": "", - "subSupportUrl": "", - "subProfileUrl": "", - "subAnnounce": "", - "subEnableRouting": "true", - "subRoutingRules": "", - "subListen": "", - "subPort": "2096", - "subPath": "/sub/", - "subDomain": "", - "subCertFile": "", - "subKeyFile": "", - "subUpdates": "12", - "subEncrypt": "true", - "subShowInfo": "true", - "subURI": "", - "subJsonPath": "/json/", - "subJsonURI": "", - "subJsonFragment": "", - "subJsonNoises": "", - "subJsonMux": "", - "subJsonRules": "", - "subClashEnable": "false", - "subClashPath": "/clash/", - "subClashURI": "", + "xrayTemplateConfig": xrayTemplateConfig, + "webListen": "", + "webDomain": "", + "webPort": "2053", + "webCertFile": "", + "webKeyFile": "", + "secret": random.Seq(32), + "webBasePath": "/", + "sessionMaxAge": "360", + "pageSize": "25", + "expireDiff": "0", + "trafficDiff": "0", + "remarkModel": "-ieo", + "timeLocation": "Local", + "tgBotEnable": "false", + "tgBotToken": "", + "tgBotProxy": "", + "tgBotAPIServer": "", + "tgBotChatId": "", + "tgRunTime": "@daily", + "tgBotBackup": "false", + "tgBotLoginNotify": "true", + "tgCpu": "80", + "tgLang": "en-US", + "twoFactorEnable": "false", + "twoFactorToken": "", + "subEnable": "true", + "subJsonEnable": "false", + "subTitle": "", + "subSupportUrl": "", + "subProfileUrl": "", + "subAnnounce": "", + "subEnableRouting": "true", + "subRoutingRules": "", + "subListen": "", + "subPort": "2096", + "subPath": "/sub/", + "subDomain": "", + "subCertFile": "", + "subKeyFile": "", + "subUpdates": "12", + "subEncrypt": "true", + "subShowInfo": "true", + "subURI": "", + "subJsonPath": "/json/", + "subJsonURI": "", + "subJsonFragment": "", + "subJsonNoises": "", + "subJsonMux": "", + "subJsonRules": "", + "subClashEnable": "false", + "subClashPath": "/clash/", + "subClashURI": "", "subClashTemplate": `port: 7890 socks-port: 7891 allow-lan: false @@ -1206,12 +1206,12 @@ func extractHostname(host string) string { func (s *SettingService) GetDefaultSettings(host string) (any, error) { type settingFunc func() (any, error) settings := map[string]settingFunc{ - "expireDiff": func() (any, error) { return s.GetExpireDiff() }, - "trafficDiff": func() (any, error) { return s.GetTrafficDiff() }, - "pageSize": func() (any, error) { return s.GetPageSize() }, - "defaultCert": func() (any, error) { return s.GetCertFile() }, - "defaultKey": func() (any, error) { return s.GetKeyFile() }, - "tgBotEnable": func() (any, error) { return s.GetTgbotEnabled() }, + "expireDiff": func() (any, error) { return s.GetExpireDiff() }, + "trafficDiff": func() (any, error) { return s.GetTrafficDiff() }, + "pageSize": func() (any, error) { return s.GetPageSize() }, + "defaultCert": func() (any, error) { return s.GetCertFile() }, + "defaultKey": func() (any, error) { return s.GetKeyFile() }, + "tgBotEnable": func() (any, error) { return s.GetTgbotEnabled() }, "subEnable": func() (any, error) { return s.GetSubEnable() }, "subJsonEnable": func() (any, error) { return s.GetSubJsonEnable() }, "subClashEnable": func() (any, error) { return s.GetSubClashEnable() }, @@ -1219,9 +1219,9 @@ func (s *SettingService) GetDefaultSettings(host string) (any, error) { "subURI": func() (any, error) { return s.GetSubURI() }, "subJsonURI": func() (any, error) { return s.GetSubJsonURI() }, "subClashURI": func() (any, error) { return s.GetSubClashURI() }, - "remarkModel": func() (any, error) { return s.GetRemarkModel() }, - "datepicker": func() (any, error) { return s.GetDatepicker() }, - "ipLimitEnable": func() (any, error) { return s.GetIpLimitEnable() }, + "remarkModel": func() (any, error) { return s.GetRemarkModel() }, + "datepicker": func() (any, error) { return s.GetDatepicker() }, + "ipLimitEnable": func() (any, error) { return s.GetIpLimitEnable() }, } result := make(map[string]any)