Pārlūkot izejas kodu

lib/db: Fix ineffassign lint issue

Jakob Borg 9 gadi atpakaļ
vecāks
revīzija
3cde608eda
2 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 3 0
      cmd/syncthing/gui_test.go
  2. 1 1
      lib/db/leveldb_transactions.go

+ 3 - 0
cmd/syncthing/gui_test.go

@@ -507,6 +507,9 @@ func TestCSRFRequired(t *testing.T) {
 	cfg := new(mockedConfig)
 	cfg.gui.APIKey = testAPIKey
 	baseURL, err := startHTTP(cfg)
+	if err != nil {
+		t.Fatal("Unexpected error from getting base URL:", err)
+	}
 
 	cli := &http.Client{
 		Timeout: time.Second,

+ 1 - 1
lib/db/leveldb_transactions.go

@@ -128,7 +128,7 @@ func (t readWriteTransaction) updateGlobal(folder, device []byte, file protocol.
 		Version: file.Version,
 	}
 
-	insertedAt := -1
+	var insertedAt int
 	// Find a position in the list to insert this file. The file at the front
 	// of the list is the newer, the "global".
 	for i := range fl.Versions {