mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
update golangci-lint and replace deprecated calls to io/ioutil
This commit is contained in:
committed by
Benj Fassbind
parent
71fd730598
commit
352f4e8772
+1
-2
@@ -3,7 +3,6 @@ package api
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
@@ -31,7 +30,7 @@ type ApiSuite struct {
|
||||
var _ = Suite(&ApiSuite{})
|
||||
|
||||
func createTestConfig() *os.File {
|
||||
file, err := ioutil.TempFile("", "aptly")
|
||||
file, err := os.CreateTemp("", "aptly")
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
+1
-2
@@ -2,7 +2,6 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -37,7 +36,7 @@ func apiGPGAddKey(c *gin.Context) {
|
||||
}
|
||||
if len(b.GpgKeyArmor) > 0 {
|
||||
var tempdir string
|
||||
tempdir, err = ioutil.TempDir(os.TempDir(), "aptly")
|
||||
tempdir, err = os.MkdirTemp(os.TempDir(), "aptly")
|
||||
if err != nil {
|
||||
c.AbortWithError(400, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user