Changeset 652 in code for trunk/server_test.go


Ignore:
Timestamp:
Oct 18, 2021, 5:15:15 PM (4 years ago)
Author:
contact
Message:

Add context args to Database interface

This is a mecanical change, which just lifts up the context.TODO()
calls from inside the DB implementations to the callers.

Future work involves properly wiring up the contexts when it makes
sense.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server_test.go

    r623 r652  
    22
    33import (
     4        "context"
    45        "net"
    56        "testing"
     
    4445
    4546        record := &User{Username: testUsername, Password: string(hashed)}
    46         if err := db.StoreUser(record); err != nil {
     47        if err := db.StoreUser(context.TODO(), record); err != nil {
    4748                t.Fatalf("failed to store test user: %v", err)
    4849        }
     
    6970                Enabled: true,
    7071        }
    71         if err := db.StoreNetwork(user.ID, network); err != nil {
     72        if err := db.StoreNetwork(context.TODO(), user.ID, network); err != nil {
    7273                t.Fatalf("failed to store test network: %v", err)
    7374        }
Note: See TracChangeset for help on using the changeset viewer.