mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-26 13:47:40 +00:00
replace io/ioutil
fixes golangci-lint errors
This commit is contained in:
+1
-2
@@ -2,7 +2,6 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
@@ -488,7 +487,7 @@ func apiMirrorsUpdate(c *gin.Context) {
|
|||||||
task.TempDownPath, e = pp.GenerateTempPath(task.File.Filename)
|
task.TempDownPath, e = pp.GenerateTempPath(task.File.Filename)
|
||||||
} else {
|
} else {
|
||||||
var file *os.File
|
var file *os.File
|
||||||
file, e = ioutil.TempFile("", task.File.Filename)
|
file, e = os.CreateTemp("", task.File.Filename)
|
||||||
if e == nil {
|
if e == nil {
|
||||||
task.TempDownPath = file.Name()
|
task.TempDownPath = file.Name()
|
||||||
file.Close()
|
file.Close()
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package azure
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
@@ -105,7 +104,7 @@ func (pool *PackagePool) Size(path string) (int64, error) {
|
|||||||
func (pool *PackagePool) Open(path string) (aptly.ReadSeekerCloser, error) {
|
func (pool *PackagePool) Open(path string) (aptly.ReadSeekerCloser, error) {
|
||||||
blob := pool.az.blobURL(path)
|
blob := pool.az.blobURL(path)
|
||||||
|
|
||||||
temp, err := ioutil.TempFile("", "blob-download")
|
temp, err := os.CreateTemp("", "blob-download")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "error creating temporary file for blob download")
|
return nil, errors.Wrap(err, "error creating temporary file for blob download")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -167,7 +166,7 @@ func aptlyMirrorUpdate(cmd *commander.Command, args []string) error {
|
|||||||
task.TempDownPath, e = pp.GenerateTempPath(task.File.Filename)
|
task.TempDownPath, e = pp.GenerateTempPath(task.File.Filename)
|
||||||
} else {
|
} else {
|
||||||
var file *os.File
|
var file *os.File
|
||||||
file, e = ioutil.TempFile("", task.File.Filename)
|
file, e = os.CreateTemp("", task.File.Filename)
|
||||||
if e == nil {
|
if e == nil {
|
||||||
task.TempDownPath = file.Name()
|
task.TempDownPath = file.Name()
|
||||||
file.Close()
|
file.Close()
|
||||||
|
|||||||
Reference in New Issue
Block a user