use std slices package (#4008)

This commit is contained in:
fatedier authored and GitHub committed 2024-02-20 12:01:41 +08:00
1 parent b6361fb143
commit 3e0c78233a
22 files changed
+75 -84

No files matched your search

+2 -2
View File
@@ -18,9 +18,9 @@ import (
"fmt"
"os"
"path/filepath"
"slices"
"strings"
"github.com/samber/lo"
"gopkg.in/ini.v1"
legacyauth "github.com/fatedier/frp/pkg/auth/legacy"
@@ -399,7 +399,7 @@ func (cfg *ClientCommonConf) Validate() error {
}
}
if !lo.Contains([]string{"tcp", "kcp", "quic", "websocket", "wss"}, cfg.Protocol) {
if !slices.Contains([]string{"tcp", "kcp", "quic", "websocket", "wss"}, cfg.Protocol) {
return fmt.Errorf("invalid protocol")
}