From a60a4c9117c1cc8a55ead9bdcb99aed6ef8bce7a Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 21 May 2021 14:16:59 +1000 Subject: [PATCH] Progress testing without cgo a bit --- storage/sqlite/direct.go | 4 ++++ storage/sqlite/sqlite-storage-cli/main.go | 4 ++++ storage/sqlite/sqlite-storage.go | 4 ++++ storage/sqlite/sqlite-storage_test.go | 8 ++++++-- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/storage/sqlite/direct.go b/storage/sqlite/direct.go index 0287f56b..d51e1321 100644 --- a/storage/sqlite/direct.go +++ b/storage/sqlite/direct.go @@ -1,3 +1,6 @@ +//go:build cgo +// +build cgo + package sqliteStorage import ( @@ -9,6 +12,7 @@ import ( "crawshaw.io/sqlite" "crawshaw.io/sqlite/sqlitex" + "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/storage" ) diff --git a/storage/sqlite/sqlite-storage-cli/main.go b/storage/sqlite/sqlite-storage-cli/main.go index 5f315743..7db859f1 100644 --- a/storage/sqlite/sqlite-storage-cli/main.go +++ b/storage/sqlite/sqlite-storage-cli/main.go @@ -1,3 +1,6 @@ +//go:build cgo +// +build cgo + package main import ( @@ -7,6 +10,7 @@ import ( "crawshaw.io/sqlite" "github.com/alexflint/go-arg" + sqliteStorage "github.com/anacrolix/torrent/storage/sqlite" ) diff --git a/storage/sqlite/sqlite-storage.go b/storage/sqlite/sqlite-storage.go index 172f1d35..38f734fe 100644 --- a/storage/sqlite/sqlite-storage.go +++ b/storage/sqlite/sqlite-storage.go @@ -1,3 +1,6 @@ +//go:build cgo +// +build cgo + package sqliteStorage import ( @@ -20,6 +23,7 @@ import ( "crawshaw.io/sqlite/sqlitex" "github.com/anacrolix/missinggo/iter" "github.com/anacrolix/missinggo/v2/resource" + "github.com/anacrolix/torrent/storage" ) diff --git a/storage/sqlite/sqlite-storage_test.go b/storage/sqlite/sqlite-storage_test.go index e40aae35..2494ce6d 100644 --- a/storage/sqlite/sqlite-storage_test.go +++ b/storage/sqlite/sqlite-storage_test.go @@ -1,3 +1,6 @@ +//go:build cgo +// +build cgo + package sqliteStorage import ( @@ -12,12 +15,13 @@ import ( "time" _ "github.com/anacrolix/envpprof" - "github.com/anacrolix/torrent/storage" - test_storage "github.com/anacrolix/torrent/storage/test" "github.com/dustin/go-humanize" qt "github.com/frankban/quicktest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anacrolix/torrent/storage" + test_storage "github.com/anacrolix/torrent/storage/test" ) func newConnsAndProv(t *testing.T, opts NewPoolOpts) (ConnPool, *provider) {