diff options
author | Wim <wim@42.be> | 2020-11-22 15:55:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-22 15:55:57 +0100 |
commit | 4cc2c914e634eb8c79eb61aa1bc29faf6021ffcf (patch) | |
tree | 92d3b8d27cd35455eae7423e4d47aad67cc6a43b /vendor/github.com/mattermost/mattermost-server/v5/model/utils.go | |
parent | cbb46293ab670c1989bfcd9aae5d853223074038 (diff) | |
download | matterbridge-msglm-4cc2c914e634eb8c79eb61aa1bc29faf6021ffcf.tar.gz matterbridge-msglm-4cc2c914e634eb8c79eb61aa1bc29faf6021ffcf.tar.bz2 matterbridge-msglm-4cc2c914e634eb8c79eb61aa1bc29faf6021ffcf.zip |
Update vendor (#1297)
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v5/model/utils.go')
-rw-r--r-- | vendor/github.com/mattermost/mattermost-server/v5/model/utils.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v5/model/utils.go b/vendor/github.com/mattermost/mattermost-server/v5/model/utils.go index 2ab71090..9a7ab229 100644 --- a/vendor/github.com/mattermost/mattermost-server/v5/model/utils.go +++ b/vendor/github.com/mattermost/mattermost-server/v5/model/utils.go @@ -36,6 +36,26 @@ type StringInterface map[string]interface{} type StringMap map[string]string type StringArray []string +func (sa StringArray) Remove(input string) StringArray { + for index := range sa { + if sa[index] == input { + ret := make(StringArray, 0, len(sa)-1) + ret = append(ret, sa[:index]...) + return append(ret, sa[index+1:]...) + } + } + return sa +} + +func (sa StringArray) Contains(input string) bool { + for index := range sa { + if sa[index] == input { + return true + } + } + + return false +} func (sa StringArray) Equals(input StringArray) bool { if len(sa) != len(input) { |