Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Fix linter errors to reflect update to Go 1.20

Gabe Kangasb7c06ecadfed
diff --git a/activitypub/resolvers/resolve.go b/activitypub/resolvers/resolve.go
index 345a7a8310..35c102bfbe 100644
--- a/activitypub/resolvers/resolve.go
+++ b/activitypub/resolvers/resolve.go
@@ -3,7 +3,7 @@ package resolvers
import (
"context"
"encoding/json"
- "io/ioutil"
+ "io"
"net/http"
"github.com/go-fed/activity/streams"
@@ -63,7 +63,7 @@ func ResolveIRI(c context.Context, iri string, callbacks ...interface{}) error {
defer response.Body.Close()
- data, err := ioutil.ReadAll(response.Body)
+ data, err := io.ReadAll(response.Body)
if err != nil {
return err
}
diff --git a/controllers/admin/update.go b/controllers/admin/update.go
index b42bf2c4c4..8f93fa37bb 100644
--- a/controllers/admin/update.go
+++ b/controllers/admin/update.go
@@ -3,7 +3,6 @@ package admin
import (
"fmt"
"io"
- "io/ioutil"
"net/http"
"os"
"os/exec"
@@ -147,7 +146,7 @@ func getContainerID() string {
pid := os.Getppid()
cgroupPath := fmt.Sprintf("/proc/%s/cgroup", strconv.Itoa(pid))
containerID := ""
- content, err := ioutil.ReadFile(cgroupPath) //nolint:gosec
+ content, err := os.ReadFile(cgroupPath) //nolint:gosec
if err != nil {
return containerID
}
diff --git a/utils/utils.go b/utils/utils.go
index 85801786b3..4ca58455f6 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -14,7 +14,6 @@ import (
"path/filepath"
"regexp"
"strings"
- "time"
log "github.com/sirupsen/logrus"
"github.com/yuin/goldmark"
@@ -358,7 +357,6 @@ func GetHashtagsFromText(text string) []string {
// ShuffleStringSlice will shuffle a slice of strings.
func ShuffleStringSlice(s []string) []string {
- rand.Seed(time.Now().UnixNano())
rand.Shuffle(len(s), func(i, j int) {
s[i], s[j] = s[j], s[i]
})