https://stackoverflow.com/a/70802740/15807350
(s []T, e T)
| 19 | |
| 20 | // https://stackoverflow.com/a/70802740/15807350 |
| 21 | func Contains[T comparable](s []T, e T) bool { |
| 22 | for _, v := range s { |
| 23 | if v == e { |
| 24 | return true |
| 25 | } |
| 26 | } |
| 27 | return false |
| 28 | } |
| 29 | |
| 30 | // IsClientDisconnectError checks if the error is due to client disconnecting |
| 31 | // e.g. user seeking in video, stopping playback, or network issues on client side |