build: Enable gometalinter "unconvert" check

This commit is contained in:
Jakob Borg
2016-12-17 15:37:11 +01:00
committed by Jakob Borg
parent 744c2e82b5
commit 47f22ff3e5
12 changed files with 17 additions and 15 deletions

View File

@@ -209,7 +209,7 @@ func blockKeyInto(o, hash []byte, folder uint32, file string) []byte {
}
o[0] = KeyTypeBlock
binary.BigEndian.PutUint32(o[keyPrefixLen:], folder)
copy(o[keyPrefixLen+keyFolderLen:], []byte(hash))
copy(o[keyPrefixLen+keyFolderLen:], hash)
copy(o[keyPrefixLen+keyFolderLen+keyHashLen:], []byte(file))
return o
}

View File

@@ -635,7 +635,7 @@ func (db *Instance) deviceKeyInto(k []byte, folder, device, file []byte) []byte
k[0] = KeyTypeDevice
binary.BigEndian.PutUint32(k[keyPrefixLen:], db.folderIdx.ID(folder))
binary.BigEndian.PutUint32(k[keyPrefixLen+keyFolderLen:], db.deviceIdx.ID(device))
copy(k[keyPrefixLen+keyFolderLen+keyDeviceLen:], []byte(file))
copy(k[keyPrefixLen+keyFolderLen+keyDeviceLen:], file)
return k[:reqLen]
}
@@ -670,7 +670,7 @@ func (db *Instance) globalKey(folder, file []byte) []byte {
k := make([]byte, keyPrefixLen+keyFolderLen+len(file))
k[0] = KeyTypeGlobal
binary.BigEndian.PutUint32(k[keyPrefixLen:], db.folderIdx.ID(folder))
copy(k[keyPrefixLen+keyFolderLen:], []byte(file))
copy(k[keyPrefixLen+keyFolderLen:], file)
return k
}

View File

@@ -522,7 +522,7 @@ func (c *rawConnection) handleRequest(req Request) {
buf = make([]byte, size)
}
err := c.receiver.Request(c.id, req.Folder, req.Name, int64(req.Offset), req.Hash, req.FromTemporary, buf)
err := c.receiver.Request(c.id, req.Folder, req.Name, req.Offset, req.Hash, req.FromTemporary, buf)
if err != nil {
c.send(&Response{
ID: req.ID,

View File

@@ -56,7 +56,7 @@ func Blocks(r io.Reader, blocksize int, sizehint int64, counter Counter) ([]prot
}
if counter != nil {
counter.Update(int64(n))
counter.Update(n)
}
// Carve out a hash-sized chunk of "hashes" to store the hash for this
@@ -72,7 +72,7 @@ func Blocks(r io.Reader, blocksize int, sizehint int64, counter Counter) ([]prot
}
blocks = append(blocks, b)
offset += int64(n)
offset += n
hf.Reset()
whf.Reset()

View File

@@ -163,7 +163,7 @@ func (w *walker) walk() (chan protocol.FileInfo, error) {
for file := range toHashChan {
filesToHash = append(filesToHash, file)
total += int64(file.Size)
total += file.Size
}
realToHashChan := make(chan protocol.FileInfo)

View File

@@ -17,7 +17,7 @@ import (
)
var (
threshold = time.Duration(100 * time.Millisecond)
threshold = 100 * time.Millisecond
l = logger.DefaultLogger.NewFacility("sync", "Mutexes")
// We make an exception in this package and have an actual "if debug { ...