build fixes

This commit is contained in:
Henry 2021-02-09 17:29:42 +01:00
parent 830678c914
commit 2f907a1753
2 changed files with 11 additions and 4 deletions

View File

@ -4,10 +4,13 @@ package main
import (
"bytes"
"context"
"fmt"
"os"
"syscall"
"github.com/ssb-ngi-pointer/gossb-rooms/internal/repo"
_ "github.com/mattn/go-sqlite3"
"golang.org/x/crypto/ssh/terminal"
@ -17,12 +20,14 @@ import (
func main() {
if len(os.Args) != 3 {
fmt.Fprintf(os.Stderr, "usage: %s <file.db> <user-name>\n", os.Args[0])
fmt.Fprintf(os.Stderr, "usage: %s <repo-location> <user-name>\n", os.Args[0])
fmt.Fprintf(os.Stderr, "repo-location: default is $HOME/.ssb-go-room\n")
os.Exit(1)
return
}
db, err := sqlite.Open(os.Args[1])
r := repo.New(os.Args[1])
db, err := sqlite.Open(r)
check(err)
defer db.Close()
@ -39,8 +44,8 @@ func main() {
os.Exit(1)
return
}
err = db.AuthFallback.Create(os.Args[2], bytePassword)
ctx := context.Background()
err = db.AuthFallback.Create(ctx, os.Args[2], bytePassword)
check(err)
}

View File

@ -73,6 +73,8 @@ type testHandler struct {
wantServer bool
}
func (testHandler) Handled(muxrpc.Method) bool { return true }
func (th testHandler) HandleConnect(ctx context.Context, e muxrpc.Endpoint) {
require.Equal(th.t, th.wantServer, muxrpc.IsServer(e), "server assertion failed")
}