🐛 FIX: 适配go1.19

This commit is contained in:
dexter
2022-10-13 18:37:31 +08:00
parent 80368d1506
commit c214c44f17
6 changed files with 130 additions and 30 deletions

6
io.go
View File

@@ -131,11 +131,11 @@ func (io *IO[C]) receive(streamPath string, specific IIO, conf *C) error {
if v, ok := c.(*config.Publish); ok {
io.Type = strings.TrimSuffix(io.Type, "Publisher")
oldPublisher := s.Publisher
if s.Publisher != nil && !s.Publisher.IsClosed() {
if oldPublisher != nil && !oldPublisher.IsClosed() {
// 根据配置是否剔出原来的发布者
if v.KickExist {
s.Warn("kick", zap.String("type", s.Publisher.GetIO().Type))
s.Publisher.OnEvent(SEKick{})
s.Warn("kick", zap.String("type", oldPublisher.GetIO().Type))
oldPublisher.OnEvent(SEKick{})
} else {
return BadNameErr
}