Skip to content

Commit 8b7c3a5

Browse files
committed
go standard library has got you covered :)
1 parent c5e017c commit 8b7c3a5

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

internals/proxy/middlewares/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"encoding/base64"
55
"net/http"
66
"net/url"
7+
"slices"
78
"strings"
89

9-
"github.com/codeshelldev/secured-signal-api/utils"
1010
log "github.com/codeshelldev/secured-signal-api/utils/logger"
1111
)
1212

@@ -36,7 +36,7 @@ func getAuthType(str string) authType {
3636
}
3737

3838
func isValidToken(tokens []string, match string) (bool) {
39-
return utils.Contains(tokens, match)
39+
return slices.Contains(tokens, match)
4040
}
4141

4242
func (data AuthMiddleware) Use() http.Handler {

utils/utils.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ func StringToArray(sliceStr string) ([]string, error) {
3030
return tokens, nil
3131
}
3232

33-
func Contains[T comparable](list []T, item T) (bool){
34-
for _, match := range list {
35-
if match == item {
36-
return true
37-
}
38-
}
39-
40-
return false
41-
}
42-
4333
func GetJsonSafe[T any](jsonStr string) (T, error) {
4434
var result T
4535

0 commit comments

Comments
 (0)