mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Fix linting errors
This commit is contained in:
+2
-1
@@ -203,7 +203,8 @@ func packageIndexByHash(file *indexFile, ext string, hash string, sum string) er
|
|||||||
if file.parent.publishedStorage.FileExists(filepath.Join(dst, indexfile)) {
|
if file.parent.publishedStorage.FileExists(filepath.Join(dst, indexfile)) {
|
||||||
// if exists, remove old symlink
|
// if exists, remove old symlink
|
||||||
if file.parent.publishedStorage.FileExists(filepath.Join(dst, indexfile+".old")) {
|
if file.parent.publishedStorage.FileExists(filepath.Join(dst, indexfile+".old")) {
|
||||||
link, err := file.parent.publishedStorage.ReadLink(filepath.Join(dst, indexfile+".old"))
|
var link string
|
||||||
|
link, err = file.parent.publishedStorage.ReadLink(filepath.Join(dst, indexfile+".old"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
file.parent.publishedStorage.Remove(link)
|
file.parent.publishedStorage.Remove(link)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-5
@@ -426,11 +426,7 @@ func (storage *PublishedStorage) FileExists(path string) bool {
|
|||||||
Key: aws.String(filepath.Join(storage.prefix, path)),
|
Key: aws.String(filepath.Join(storage.prefix, path)),
|
||||||
}
|
}
|
||||||
_, err := storage.s3.HeadObject(params)
|
_, err := storage.s3.HeadObject(params)
|
||||||
if err != nil {
|
return err == nil
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadLink returns the symbolic link pointed to by path.
|
// ReadLink returns the symbolic link pointed to by path.
|
||||||
|
|||||||
+1
-3
@@ -284,8 +284,7 @@ func (s *PublishedStorageSuite) TestLinkFromPool(c *C) {
|
|||||||
func (s *PublishedStorageSuite) TestSymLink(c *C) {
|
func (s *PublishedStorageSuite) TestSymLink(c *C) {
|
||||||
s.PutFile(c, "a/b", []byte("test"))
|
s.PutFile(c, "a/b", []byte("test"))
|
||||||
|
|
||||||
var err error
|
err := s.storage.SymLink("a/b", "a/b.link")
|
||||||
err = s.storage.SymLink("a/b", "a/b.link")
|
|
||||||
c.Check(err, IsNil)
|
c.Check(err, IsNil)
|
||||||
|
|
||||||
var link string
|
var link string
|
||||||
@@ -296,7 +295,6 @@ func (s *PublishedStorageSuite) TestSymLink(c *C) {
|
|||||||
c.Skip("copy not available in s3test")
|
c.Skip("copy not available in s3test")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (s *PublishedStorageSuite) TestFileExists(c *C) {
|
func (s *PublishedStorageSuite) TestFileExists(c *C) {
|
||||||
s.PutFile(c, "a/b", []byte("test"))
|
s.PutFile(c, "a/b", []byte("test"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user