Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-05-13 12:59:10 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-05-13 12:59:10 +0300
commit77241c7fcf156b6ebee13bf58f4342aca16292e1 (patch)
tree337ee6f97aa752389173831736ab731b4e6808dc
parentfd6a85afd9d1f5700245ce152844472b1cd24923 (diff)
pruning some codes
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
-rw-r--r--util/common/err.go2
-rw-r--r--util/common/stringUtil.go9
-rw-r--r--util/context.go12
-rw-r--r--util/json_util/json.go4
-rw-r--r--util/sys/a.s0
5 files changed, 2 insertions, 25 deletions
diff --git a/util/common/err.go b/util/common/err.go
index c0ecbbb8..f6078c33 100644
--- a/util/common/err.go
+++ b/util/common/err.go
@@ -6,8 +6,6 @@ import (
"x-ui/logger"
)
-var CtxDone = errors.New("context done")
-
func NewErrorf(format string, a ...interface{}) error {
msg := fmt.Sprintf(format, a...)
return errors.New(msg)
diff --git a/util/common/stringUtil.go b/util/common/stringUtil.go
deleted file mode 100644
index 5f1f93fd..00000000
--- a/util/common/stringUtil.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package common
-
-import "sort"
-
-func IsSubString(target string, str_array []string) bool {
- sort.Strings(str_array)
- index := sort.SearchStrings(str_array, target)
- return index < len(str_array) && str_array[index] == target
-}
diff --git a/util/context.go b/util/context.go
deleted file mode 100644
index b768f05c..00000000
--- a/util/context.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package util
-
-import "context"
-
-func IsDone(ctx context.Context) bool {
- select {
- case <-ctx.Done():
- return true
- default:
- return false
- }
-}
diff --git a/util/json_util/json.go b/util/json_util/json.go
index 65ad789e..54e3728a 100644
--- a/util/json_util/json.go
+++ b/util/json_util/json.go
@@ -6,7 +6,7 @@ import (
type RawMessage []byte
-// MarshalJSON 自定义 json.RawMessage 默认行为
+// MarshalJSON: Customize json.RawMessage default behavior
func (m RawMessage) MarshalJSON() ([]byte, error) {
if len(m) == 0 {
return []byte("null"), nil
@@ -14,7 +14,7 @@ func (m RawMessage) MarshalJSON() ([]byte, error) {
return m, nil
}
-// UnmarshalJSON sets *m to a copy of data.
+// UnmarshalJSON: sets *m to a copy of data.
func (m *RawMessage) UnmarshalJSON(data []byte) error {
if m == nil {
return errors.New("json.RawMessage: UnmarshalJSON on nil pointer")
diff --git a/util/sys/a.s b/util/sys/a.s
deleted file mode 100644
index e69de29b..00000000
--- a/util/sys/a.s
+++ /dev/null