mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-13 14:31:15 +00:00
WIP: support for multiple WireGuard devices (#2)
This commit is contained in:
@@ -60,6 +60,16 @@ func ListToString(lst []string) string {
|
||||
return strings.Join(lst, ", ")
|
||||
}
|
||||
|
||||
// ListContains checks if a needle exists in the given list.
|
||||
func ListContains(lst []string, needle string) bool {
|
||||
for _, entry := range lst {
|
||||
if entry == needle {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/
|
||||
func ByteCountSI(b int64) string {
|
||||
const unit = 1000
|
||||
|
Reference in New Issue
Block a user