mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +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,7 +1,6 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
. "gopkg.in/check.v1"
|
||||
@@ -14,7 +13,7 @@ type ChecksumSuite struct {
|
||||
var _ = Suite(&ChecksumSuite{})
|
||||
|
||||
func (s *ChecksumSuite) SetUpTest(c *C) {
|
||||
s.tempfile, _ = ioutil.TempFile(c.MkDir(), "aptly-test")
|
||||
s.tempfile, _ = os.CreateTemp(c.MkDir(), "aptly-test")
|
||||
s.tempfile.WriteString(testString)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ var _ = Suite(&CompressSuite{})
|
||||
const testString = "Quick brown fox jumps over black dog and runs away... Really far away... who knows?"
|
||||
|
||||
func (s *CompressSuite) SetUpTest(c *C) {
|
||||
s.tempfile, _ = ioutil.TempFile(c.MkDir(), "aptly-test")
|
||||
s.tempfile, _ = os.CreateTemp(c.MkDir(), "aptly-test")
|
||||
s.tempfile.WriteString(testString)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -16,7 +15,7 @@ type CopyfileSuite struct {
|
||||
var _ = Suite(&CopyfileSuite{})
|
||||
|
||||
func (s *CopyfileSuite) SetUpSuite(c *C) {
|
||||
s.source, _ = ioutil.TempFile(c.MkDir(), "source-file")
|
||||
s.source, _ = os.CreateTemp(c.MkDir(), "source-file")
|
||||
s.dest = filepath.Join(filepath.Dir(s.source.Name()), "destination-file")
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
@@ -22,7 +21,7 @@ type UtilsSuite struct {
|
||||
var _ = Suite(&UtilsSuite{})
|
||||
|
||||
func (s *UtilsSuite) SetUpSuite(c *C) {
|
||||
s.tempfile, _ = ioutil.TempFile(c.MkDir(), "aptly-test-inaccessible")
|
||||
s.tempfile, _ = os.CreateTemp(c.MkDir(), "aptly-test-inaccessible")
|
||||
if err := os.Chmod(s.tempfile.Name(), 0000); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user