Variable collisions; Possible use of nil value (#256)

* Variable '*' collides with imported package name

* Variable 'error' collides with builtin interface

* '*' may have 'nil' or other unexpected value as its corresponding error variable may be not 'nil'
This commit is contained in:
bitspill
2020-10-16 15:04:31 -07:00
committed by GitHub
parent 3812e6345f
commit bfbac8cc57
10 changed files with 41 additions and 31 deletions

View File

@ -34,8 +34,8 @@ func Start() {
port := 1935
s := rtmp.NewServer()
var lis net.Listener
var error error
if lis, error = net.Listen("tcp", fmt.Sprintf(":%d", port)); error != nil {
var err error
if lis, err = net.Listen("tcp", fmt.Sprintf(":%d", port)); err != nil {
return
}
@ -46,8 +46,8 @@ func Start() {
s.HandleConn = HandleConn
if error != nil {
log.Panicln(error)
if err != nil {
log.Panicln(err)
}
log.Infof("RTMP server is listening for incoming stream on port: %d", port)