Cleanup linter warnings

This commit is contained in:
Gabe Kangas
2021-07-19 23:37:06 -07:00
parent 4d64539b07
commit 44d6a36b77
8 changed files with 35 additions and 20 deletions

View File

@@ -80,8 +80,8 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) {
return
}
rtmpOut, rtmpIn := io.Pipe()
_pipe = rtmpIn
rtmpOut, rtmpIn := io.Pipe()
_pipe = rtmpIn
log.Infoln("Inbound stream connected.")
_setStreamAsConnected(rtmpOut)

View File

@@ -22,9 +22,7 @@ func setupStats() error {
statsSaveTimer := time.NewTicker(1 * time.Minute)
go func() {
for range statsSaveTimer.C {
if err := saveStats(); err != nil {
panic(err)
}
saveStats()
}
}()
@@ -112,7 +110,7 @@ func pruneViewerCount() {
_stats.Viewers = viewers
}
func saveStats() error {
func saveStats() {
if err := data.SetPeakOverallViewerCount(_stats.OverallMaxViewerCount); err != nil {
log.Errorln("error saving viewer count", err)
}
@@ -124,8 +122,6 @@ func saveStats() error {
log.Errorln("error saving disconnect time", err)
}
}
return nil
}
func getSavedStats() models.Stats {

View File

@@ -45,7 +45,7 @@ func (c *Libx264Codec) GlobalFlags() string {
}
func (c *Libx264Codec) PixelFormat() string {
return "yuv420p"
return "yuv420p" //nolint:goconst
}
func (c *Libx264Codec) ExtraArguments() string {
@@ -78,7 +78,7 @@ func (c *Libx264Codec) GetPresetForLevel(l int) string {
}
if l >= len(presetMapping) {
return "superfast"
return "superfast" //nolint:goconst
}
return presetMapping[l]