Files
mattermost/utils/utils.go

37 lines
612 B
Go
Raw Normal View History

// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package utils
import (
"os"
)
func StringArrayIntersection(arr1, arr2 []string) []string {
arrMap := map[string]bool{}
result := []string{}
for _, value := range arr1 {
arrMap[value] = true
}
for _, value := range arr2 {
if arrMap[value] {
result = append(result, value)
}
}
return result
}
func FileExistsInConfigFolder(filename string) bool {
if len(filename) == 0 {
return false
}
if _, err := os.Stat(FindConfigFile(filename)); err == nil {
return true
}
return false
}