From 8afa47c351b3ee75491839dad8d56bfa86bec5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 22 Feb 2023 19:25:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/configs/plus_config.go | 42 --------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 internal/configs/plus_config.go diff --git a/internal/configs/plus_config.go b/internal/configs/plus_config.go deleted file mode 100644 index 5adee500..00000000 --- a/internal/configs/plus_config.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. - -package configs - -import ( - "encoding/json" - "github.com/iwind/TeaGo/Tea" - "os" -) - -var plusConfigFile = "plus.cache.json" - -type PlusConfig struct { - IsPlus bool `json:"isPlus"` - Components []string `json:"components"` - DayTo string `json:"dayTo"` -} - -func ReadPlusConfig() *PlusConfig { - data, err := os.ReadFile(Tea.ConfigFile(plusConfigFile)) - if err != nil { - return &PlusConfig{IsPlus: false} - } - var config = &PlusConfig{IsPlus: false} - err = json.Unmarshal(data, config) - if err != nil { - return config - } - return config -} - -func WritePlusConfig(config *PlusConfig) error { - configJSON, err := json.Marshal(config) - if err != nil { - return err - } - err = os.WriteFile(Tea.ConfigFile(plusConfigFile), configJSON, 0777) - if err != nil { - return err - } - return nil -}