From 5e318a78d24dc2d428b391dc2fc0c616df683733 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Tue, 15 Feb 2022 11:19:07 +0800 Subject: [PATCH] refactor: remove unused code --- datastructure/queue/circularqueue.go | 1 - slice/slice.go | 12 +----------- validator/validator.go | 5 ----- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/datastructure/queue/circularqueue.go b/datastructure/queue/circularqueue.go index 04ead3a..d7ab4a7 100644 --- a/datastructure/queue/circularqueue.go +++ b/datastructure/queue/circularqueue.go @@ -75,7 +75,6 @@ func (q *CircularQueue[T]) EnQueue(value T) error { } q.data[q.rear] = value - // q.data = append(q.data, value) q.rear = (q.rear + 1) % q.size return nil diff --git a/slice/slice.go b/slice/slice.go index e5f8624..81c88b6 100644 --- a/slice/slice.go +++ b/slice/slice.go @@ -30,18 +30,8 @@ func ContainSubSlice[T any](slice, subslice []T) bool { return false } } - return true - // unique := make(map[T]bool) - // for _, v := range slice { - // unique[v] = true - // } - // for _, v := range subslice { - // if !unique[v] { - // return false - // } - // } - // return true + return true } // Chunk creates an slice of elements split into groups the length of size. diff --git a/validator/validator.go b/validator/validator.go index 362d8ec..12ae43a 100644 --- a/validator/validator.go +++ b/validator/validator.go @@ -234,11 +234,6 @@ func IsStrongPassword(password string, length int) bool { } return num && lower && upper && special - - // go doesn't support regexp (?=re) - //pattern := `^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[@#$%^&+=])(?=\S+$).$` - //reg := regexp.MustCompile(pattern) - //return reg.MatchString(password) } // IsWeakPassword check if the string is weak password