Enable Uploading/Removing Attachments When Editing an Issue/Comment (#8426)

This commit is contained in:
blueworrybear 2019-10-15 20:19:32 +08:00 committed by zeripath
parent d7d348ea86
commit 8c909820a9
10 changed files with 316 additions and 39 deletions

View file

@ -35,6 +35,16 @@ func ExistsInSlice(target string, slice []string) bool {
return i < len(slice)
}
// IsStringInSlice sequential searches if string exists in slice.
func IsStringInSlice(target string, slice []string) bool {
for i := 0; i < len(slice); i++ {
if slice[i] == target {
return true
}
}
return false
}
// IsEqualSlice returns true if slices are equal.
func IsEqualSlice(target []string, source []string) bool {
if len(target) != len(source) {