0

Quiet, linter

This commit is contained in:
Gabe Kangas 2022-01-27 14:58:31 -08:00
parent 7b7bbe405b
commit 8bc40486f8
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
6 changed files with 7 additions and 7 deletions

View File

@ -326,6 +326,7 @@ func saveMessageVisibility(messageIDs []string, visible bool) error {
return err return err
} }
//nolint:gosec
stmt, err := tx.Prepare("UPDATE messages SET hidden_at=? WHERE id IN (?" + strings.Repeat(",?", len(messageIDs)-1) + ")") stmt, err := tx.Prepare("UPDATE messages SET hidden_at=? WHERE id IN (?" + strings.Repeat(",?", len(messageIDs)-1) + ")")
if err != nil { if err != nil {
return err return err

View File

@ -52,7 +52,7 @@ func SetupPersistence(file string) error {
if !utils.DoesFileExists(file) { if !utils.DoesFileExists(file) {
log.Traceln("Creating new database at", file) log.Traceln("Creating new database at", file)
_, err := os.Create(file) _, err := os.Create(file) //nolint: gosec
if err != nil { if err != nil {
log.Fatal(err.Error()) log.Fatal(err.Error())
} }

View File

@ -82,7 +82,7 @@ func createEmptyOfflinePlaylist(playlistFilePath string, offlineFilename string)
} }
p.Close() p.Close()
f, err := os.Create(playlistFilePath) f, err := os.Create(playlistFilePath) //nolint:gosec
if err != nil { if err != nil {
log.Errorln(err) log.Errorln(err)
} }

View File

@ -4,7 +4,7 @@ import "os"
// WritePlaylist writes the playlist to disk. // WritePlaylist writes the playlist to disk.
func WritePlaylist(data string, filePath string) error { func WritePlaylist(data string, filePath string) error {
f, err := os.Create(filePath) f, err := os.Create(filePath) //nolint:gosec
if err != nil { if err != nil {
return err return err
} }

View File

@ -4,12 +4,11 @@ import (
"bytes" "bytes"
"io" "io"
"net" "net"
"net/http"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"net/http"
"github.com/owncast/owncast/config" "github.com/owncast/owncast/config"
"github.com/owncast/owncast/utils" "github.com/owncast/owncast/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
@ -67,7 +66,7 @@ func (s *FileWriterReceiverService) uploadHandler(w http.ResponseWriter, r *http
_, _ = io.Copy(&buf, r.Body) _, _ = io.Copy(&buf, r.Body)
data := buf.Bytes() data := buf.Bytes()
f, err := os.Create(writePath) f, err := os.Create(writePath) //nolint: gosec
if err != nil { if err != nil {
returnError(err, w) returnError(err, w)
return return

View File

@ -39,7 +39,7 @@ func Restore(backupFile string, databaseFile string) error {
rawSQL := b.String() rawSQL := b.String()
if _, err := os.Create(databaseFile); err != nil { if _, err := os.Create(databaseFile); err != nil { //nolint: gosec
return errors.New("unable to write restored database") return errors.New("unable to write restored database")
} }