all: Revert the underscore sillyness

This commit is contained in:
Jakob Borg
2019-02-02 12:16:27 +01:00
parent 9fd270d78e
commit c2ddc83509
70 changed files with 252 additions and 252 deletions

View File

@@ -19,7 +19,7 @@ func TestIgnoredFiles(t *testing.T) {
t.Fatal(err)
}
db := NewLowlevel(ldb, "<memory>")
_ = UpdateSchema(db)
UpdateSchema(db)
fs := NewFileSet("test", fs.NewFilesystem(fs.FilesystemTypeBasic, "."), db)
@@ -204,7 +204,7 @@ func TestUpdate0to3(t *testing.T) {
func TestDowngrade(t *testing.T) {
db := OpenMemory()
_ = UpdateSchema(db) // sets the min version etc
UpdateSchema(db) // sets the min version etc
// Bump the database version to something newer than we actually support
miscDB := NewMiscDataNamespace(db)

View File

@@ -61,7 +61,7 @@ func (n *NamespacedKV) Reset() {
func (n *NamespacedKV) PutInt64(key string, val int64) {
var valBs [8]byte
binary.BigEndian.PutUint64(valBs[:], uint64(val))
_ = n.db.Put(n.prefixedKey(key), valBs[:], nil)
n.db.Put(n.prefixedKey(key), valBs[:], nil)
}
// Int64 returns the stored value interpreted as an int64 and a boolean that
@@ -79,7 +79,7 @@ func (n *NamespacedKV) Int64(key string) (int64, bool) {
// type) is overwritten.
func (n *NamespacedKV) PutTime(key string, val time.Time) {
valBs, _ := val.MarshalBinary() // never returns an error
_ = n.db.Put(n.prefixedKey(key), valBs, nil)
n.db.Put(n.prefixedKey(key), valBs, nil)
}
// Time returns the stored value interpreted as a time.Time and a boolean
@@ -97,7 +97,7 @@ func (n NamespacedKV) Time(key string) (time.Time, bool) {
// PutString stores a new string. Any existing value (even if of another type)
// is overwritten.
func (n *NamespacedKV) PutString(key, val string) {
_ = n.db.Put(n.prefixedKey(key), []byte(val), nil)
n.db.Put(n.prefixedKey(key), []byte(val), nil)
}
// String returns the stored value interpreted as a string and a boolean that
@@ -113,7 +113,7 @@ func (n NamespacedKV) String(key string) (string, bool) {
// PutBytes stores a new byte slice. Any existing value (even if of another type)
// is overwritten.
func (n *NamespacedKV) PutBytes(key string, val []byte) {
_ = n.db.Put(n.prefixedKey(key), val, nil)
n.db.Put(n.prefixedKey(key), val, nil)
}
// Bytes returns the stored value as a raw byte slice and a boolean that
@@ -130,9 +130,9 @@ func (n NamespacedKV) Bytes(key string) ([]byte, bool) {
// is overwritten.
func (n *NamespacedKV) PutBool(key string, val bool) {
if val {
_ = n.db.Put(n.prefixedKey(key), []byte{0x0}, nil)
n.db.Put(n.prefixedKey(key), []byte{0x0}, nil)
} else {
_ = n.db.Put(n.prefixedKey(key), []byte{0x1}, nil)
n.db.Put(n.prefixedKey(key), []byte{0x1}, nil)
}
}
@@ -149,7 +149,7 @@ func (n NamespacedKV) Bool(key string) (bool, bool) {
// Delete deletes the specified key. It is allowed to delete a nonexistent
// key.
func (n NamespacedKV) Delete(key string) {
_ = n.db.Delete(n.prefixedKey(key), nil)
n.db.Delete(n.prefixedKey(key), nil)
}
func (n NamespacedKV) prefixedKey(key string) []byte {

View File

@@ -101,7 +101,7 @@ func (s *FileSet) recalcCounts() {
})
s.meta.SetCreated()
_ = s.meta.toDB(s.db, []byte(s.folder))
s.meta.toDB(s.db, []byte(s.folder))
}
func (s *FileSet) Drop(device protocol.DeviceID) {
@@ -127,7 +127,7 @@ func (s *FileSet) Drop(device protocol.DeviceID) {
s.meta.resetAll(device)
}
_ = s.meta.toDB(s.db, []byte(s.folder))
s.meta.toDB(s.db, []byte(s.folder))
}
func (s *FileSet) Update(device protocol.DeviceID, fs []protocol.FileInfo) {
@@ -141,7 +141,7 @@ func (s *FileSet) Update(device protocol.DeviceID, fs []protocol.FileInfo) {
s.updateMutex.Lock()
defer s.updateMutex.Unlock()
defer func() { _ = s.meta.toDB(s.db, []byte(s.folder)) }()
defer s.meta.toDB(s.db, []byte(s.folder))
if device == protocol.LocalDeviceID {
// For the local device we have a bunch of metadata to track.
@@ -295,7 +295,7 @@ func DropDeltaIndexIDs(db *Lowlevel) {
dbi := db.NewIterator(util.BytesPrefix([]byte{KeyTypeIndexID}), nil)
defer dbi.Release()
for dbi.Next() {
_ = db.Delete(dbi.Key(), nil)
db.Delete(dbi.Key(), nil)
}
}

View File

@@ -82,7 +82,7 @@ func (i *smallIndex) ID(val []byte) uint32 {
key := make([]byte, len(i.prefix)+8) // prefix plus uint32 id
copy(key, i.prefix)
binary.BigEndian.PutUint32(key[len(i.prefix):], id)
_ = i.db.Put(key, val, nil)
i.db.Put(key, val, nil)
i.mut.Unlock()
return id
@@ -115,7 +115,7 @@ func (i *smallIndex) Delete(val []byte) {
// Put an empty value into the database. This indicates that the
// entry does not exist any more and prevents the ID from being
// reused in the future.
_ = i.db.Put(key, []byte{}, nil)
i.db.Put(key, []byte{}, nil)
// Delete reverse mapping.
delete(i.id2val, id)

View File

@@ -127,7 +127,7 @@ func (t readWriteTransaction) updateGlobal(gk, keyBuf, folder, device []byte, fi
var fl VersionList
if svl, err := t.Get(gk, nil); err == nil {
_ = fl.Unmarshal(svl) // Ignore error, continue with empty fl
fl.Unmarshal(svl) // Ignore error, continue with empty fl
}
fl, removedFV, removedAt, insertedAt := fl.update(folder, device, file, t.readOnlyTransaction)
if insertedAt == -1 {

View File

@@ -23,7 +23,7 @@ func writeJSONS(w io.Writer, db *leveldb.DB) {
defer it.Release()
enc := json.NewEncoder(w)
for it.Next() {
_ = enc.Encode(map[string][]byte{
enc.Encode(map[string][]byte{
"k": it.Key(),
"v": it.Value(),
})
@@ -54,7 +54,7 @@ func openJSONS(file string) (*leveldb.DB, error) {
return nil, err
}
_ = db.Put(row["k"], row["v"], nil)
db.Put(row["k"], row["v"], nil)
}
return db, nil