Fix linter errors to reflect update to Go 1.20

This commit is contained in:
Gabe Kangas 2023-03-24 14:42:49 -07:00
parent 24c51c831e
commit a3e890ff7a
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
3 changed files with 3 additions and 6 deletions

View File

@ -3,7 +3,7 @@ package resolvers
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"io/ioutil" "io"
"net/http" "net/http"
"github.com/go-fed/activity/streams" "github.com/go-fed/activity/streams"
@ -63,7 +63,7 @@ func ResolveIRI(c context.Context, iri string, callbacks ...interface{}) error {
defer response.Body.Close() defer response.Body.Close()
data, err := ioutil.ReadAll(response.Body) data, err := io.ReadAll(response.Body)
if err != nil { if err != nil {
return err return err
} }

View File

@ -3,7 +3,6 @@ package admin
import ( import (
"fmt" "fmt"
"io" "io"
"io/ioutil"
"net/http" "net/http"
"os" "os"
"os/exec" "os/exec"
@ -147,7 +146,7 @@ func getContainerID() string {
pid := os.Getppid() pid := os.Getppid()
cgroupPath := fmt.Sprintf("/proc/%s/cgroup", strconv.Itoa(pid)) cgroupPath := fmt.Sprintf("/proc/%s/cgroup", strconv.Itoa(pid))
containerID := "" containerID := ""
content, err := ioutil.ReadFile(cgroupPath) //nolint:gosec content, err := os.ReadFile(cgroupPath) //nolint:gosec
if err != nil { if err != nil {
return containerID return containerID
} }

View File

@ -14,7 +14,6 @@ import (
"path/filepath" "path/filepath"
"regexp" "regexp"
"strings" "strings"
"time"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/yuin/goldmark" "github.com/yuin/goldmark"
@ -358,7 +357,6 @@ func GetHashtagsFromText(text string) []string {
// ShuffleStringSlice will shuffle a slice of strings. // ShuffleStringSlice will shuffle a slice of strings.
func ShuffleStringSlice(s []string) []string { func ShuffleStringSlice(s []string) []string {
rand.Seed(time.Now().UnixNano())
rand.Shuffle(len(s), func(i, j int) { rand.Shuffle(len(s), func(i, j int) {
s[i], s[j] = s[j], s[i] s[i], s[j] = s[j], s[i]
}) })