diff --git a/backend/_example/memory_store/server/admin.go b/backend/_example/memory_store/server/admin.go index 9c1d38be..ae7da062 100644 --- a/backend/_example/memory_store/server/admin.go +++ b/backend/_example/memory_store/server/admin.go @@ -10,6 +10,7 @@ import ( "encoding/json" "github.com/go-pkgz/jrpc" + "github.com/umputun/remark/backend/app/store/admin" ) diff --git a/backend/_example/memory_store/server/admin_test.go b/backend/_example/memory_store/server/admin_test.go index f91b3998..4719f425 100644 --- a/backend/_example/memory_store/server/admin_test.go +++ b/backend/_example/memory_store/server/admin_test.go @@ -14,6 +14,7 @@ import ( "github.com/go-pkgz/jrpc" "github.com/stretchr/testify/assert" + "github.com/umputun/remark/backend/app/store/admin" ) diff --git a/backend/_example/memory_store/server/data.go b/backend/_example/memory_store/server/data.go index 9b6a9424..bc92d39a 100644 --- a/backend/_example/memory_store/server/data.go +++ b/backend/_example/memory_store/server/data.go @@ -10,6 +10,7 @@ import ( "encoding/json" "github.com/go-pkgz/jrpc" + "github.com/umputun/remark/backend/app/store" "github.com/umputun/remark/backend/app/store/engine" ) diff --git a/backend/_example/memory_store/server/data_test.go b/backend/_example/memory_store/server/data_test.go index 938e73c0..c4deb5cb 100644 --- a/backend/_example/memory_store/server/data_test.go +++ b/backend/_example/memory_store/server/data_test.go @@ -15,6 +15,7 @@ import ( "github.com/go-pkgz/jrpc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/umputun/remark/backend/app/store" "github.com/umputun/remark/backend/app/store/engine" ) diff --git a/backend/_example/memory_store/server/image_test.go b/backend/_example/memory_store/server/image_test.go index 9c8adc38..b93d2a4b 100644 --- a/backend/_example/memory_store/server/image_test.go +++ b/backend/_example/memory_store/server/image_test.go @@ -19,6 +19,7 @@ import ( "github.com/go-pkgz/jrpc" "github.com/stretchr/testify/assert" + "github.com/umputun/remark/backend/app/store/image" ) diff --git a/backend/_example/memory_store/server/rpc.go b/backend/_example/memory_store/server/rpc.go index 56ee9d04..d7a367a4 100644 --- a/backend/_example/memory_store/server/rpc.go +++ b/backend/_example/memory_store/server/rpc.go @@ -8,10 +8,10 @@ package server import ( "github.com/go-pkgz/jrpc" - "github.com/umputun/remark/backend/app/store/image" "github.com/umputun/remark/backend/app/store/admin" "github.com/umputun/remark/backend/app/store/engine" + "github.com/umputun/remark/backend/app/store/image" ) // RPC handler wraps both engine and remote server and implements all handlers for data store and admin store diff --git a/backend/_example/memory_store/server/rpc_test.go b/backend/_example/memory_store/server/rpc_test.go index ca0af979..7bf40694 100644 --- a/backend/_example/memory_store/server/rpc_test.go +++ b/backend/_example/memory_store/server/rpc_test.go @@ -15,7 +15,6 @@ import ( "time" "github.com/go-pkgz/jrpc" - log "github.com/go-pkgz/lgr" "github.com/stretchr/testify/require" "github.com/umputun/remark/memory_store/accessor" @@ -64,7 +63,7 @@ func prepTestStore(t *testing.T) (s *RPC, port int, teardown func()) { port = chooseRandomUnusedPort() go func() { - log.Printf("%v", s.Run(port)) + t.Logf("%v", s.Run(port)) }() waitForHTTPServerStart(port) diff --git a/backend/app/cmd/avatar.go b/backend/app/cmd/avatar.go index 8d3fc70b..491328d1 100644 --- a/backend/app/cmd/avatar.go +++ b/backend/app/cmd/avatar.go @@ -3,9 +3,9 @@ package cmd import ( "path" - bolt "go.etcd.io/bbolt" log "github.com/go-pkgz/lgr" "github.com/pkg/errors" + bolt "go.etcd.io/bbolt" "github.com/go-pkgz/auth/avatar" ) diff --git a/backend/app/cmd/server.go b/backend/app/cmd/server.go index 5d13bd92..71a0bbe0 100644 --- a/backend/app/cmd/server.go +++ b/backend/app/cmd/server.go @@ -14,13 +14,13 @@ import ( "syscall" "time" - bolt "go.etcd.io/bbolt" "github.com/dgrijalva/jwt-go" "github.com/go-pkgz/jrpc" log "github.com/go-pkgz/lgr" "github.com/kyokomi/emoji" authcache "github.com/patrickmn/go-cache" "github.com/pkg/errors" + bolt "go.etcd.io/bbolt" "github.com/go-pkgz/auth" "github.com/go-pkgz/auth/avatar" diff --git a/backend/app/main_test.go b/backend/app/main_test.go index 92f5e98d..46c7569f 100644 --- a/backend/app/main_test.go +++ b/backend/app/main_test.go @@ -13,7 +13,6 @@ import ( "testing" "time" - log "github.com/go-pkgz/lgr" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -62,7 +61,7 @@ func TestGetDump(t *testing.T) { assert.True(t, strings.Contains(dump, "goroutine")) assert.True(t, strings.Contains(dump, "[running]")) assert.True(t, strings.Contains(dump, "backend/app/main.go")) - log.Printf("\n dump: %s", dump) + t.Logf("\n dump: %s", dump) } func chooseRandomUnusedPort() (port int) { diff --git a/backend/app/migrator/disqus_test.go b/backend/app/migrator/disqus_test.go index 362d56e1..7a31c590 100644 --- a/backend/app/migrator/disqus_test.go +++ b/backend/app/migrator/disqus_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - bolt "go.etcd.io/bbolt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + bolt "go.etcd.io/bbolt" "github.com/umputun/remark/backend/app/store" "github.com/umputun/remark/backend/app/store/admin" diff --git a/backend/app/migrator/migrator_test.go b/backend/app/migrator/migrator_test.go index 2fbadf24..3c1a19a5 100644 --- a/backend/app/migrator/migrator_test.go +++ b/backend/app/migrator/migrator_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - bolt "go.etcd.io/bbolt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + bolt "go.etcd.io/bbolt" "github.com/umputun/remark/backend/app/store" "github.com/umputun/remark/backend/app/store/admin" diff --git a/backend/app/migrator/native_test.go b/backend/app/migrator/native_test.go index 8654b6bb..34b33447 100644 --- a/backend/app/migrator/native_test.go +++ b/backend/app/migrator/native_test.go @@ -10,10 +10,9 @@ import ( "testing" "time" - bolt "go.etcd.io/bbolt" - log "github.com/go-pkgz/lgr" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + bolt "go.etcd.io/bbolt" "github.com/umputun/remark/backend/app/store" "github.com/umputun/remark/backend/app/store/admin" @@ -35,7 +34,7 @@ func TestNative_Export(t *testing.T) { assert.Equal(t, 2, size) c1 := buf.String() - log.Print(c1) + t.Log(c1) dec := json.NewDecoder(strings.NewReader(c1)) diff --git a/backend/app/migrator/wordpress_test.go b/backend/app/migrator/wordpress_test.go index d239bb83..cea8bf19 100644 --- a/backend/app/migrator/wordpress_test.go +++ b/backend/app/migrator/wordpress_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - bolt "go.etcd.io/bbolt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + bolt "go.etcd.io/bbolt" "github.com/umputun/remark/backend/app/store" "github.com/umputun/remark/backend/app/store/admin" diff --git a/backend/app/rest/api/admin_test.go b/backend/app/rest/api/admin_test.go index 1fe29b31..94611feb 100644 --- a/backend/app/rest/api/admin_test.go +++ b/backend/app/rest/api/admin_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - jwt "github.com/dgrijalva/jwt-go" + "github.com/dgrijalva/jwt-go" "github.com/go-pkgz/auth/token" cache "github.com/go-pkgz/lcw" R "github.com/go-pkgz/rest" diff --git a/backend/app/rest/api/rest_test.go b/backend/app/rest/api/rest_test.go index 297d51b2..ec892769 100644 --- a/backend/app/rest/api/rest_test.go +++ b/backend/app/rest/api/rest_test.go @@ -17,15 +17,14 @@ import ( "testing" "time" - bolt "go.etcd.io/bbolt" "github.com/go-pkgz/auth" "github.com/go-pkgz/auth/avatar" "github.com/go-pkgz/auth/token" cache "github.com/go-pkgz/lcw" - log "github.com/go-pkgz/lgr" R "github.com/go-pkgz/rest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + bolt "go.etcd.io/bbolt" "github.com/umputun/remark/backend/app/migrator" "github.com/umputun/remark/backend/app/notify" @@ -327,8 +326,6 @@ func TestRest_cacheControl(t *testing.T) { } func startupT(t *testing.T) (ts *httptest.Server, srv *Rest, teardown func()) { - log.Setup(log.CallerFile, log.CallerFunc, log.Msec, log.LevelBraces) - tmp := os.TempDir() var testDb string // pick a file name which is not in use for sure diff --git a/backend/app/rest/user_test.go b/backend/app/rest/user_test.go index 485ebad2..86f54720 100644 --- a/backend/app/rest/user_test.go +++ b/backend/app/rest/user_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/umputun/remark/backend/app/store" ) @@ -20,7 +21,7 @@ func TestUser_GetUserInfo(t *testing.T) { assert.Equal(t, store.User{Name: "test", ID: "id", SiteID: "test"}, u) } -func TestUSer_MustGetUserInfo(t *testing.T) { +func TestUser_MustGetUserInfo(t *testing.T) { defer func() { if r := recover(); r != nil { t.Log("recovered from panic") diff --git a/backend/app/store/engine/bolt.go b/backend/app/store/engine/bolt.go index 0113b030..d8d53ead 100644 --- a/backend/app/store/engine/bolt.go +++ b/backend/app/store/engine/bolt.go @@ -7,10 +7,10 @@ import ( "strings" "time" - bolt "go.etcd.io/bbolt" log "github.com/go-pkgz/lgr" "github.com/hashicorp/go-multierror" "github.com/pkg/errors" + bolt "go.etcd.io/bbolt" "github.com/umputun/remark/backend/app/store" ) diff --git a/backend/app/store/engine/bolt_test.go b/backend/app/store/engine/bolt_test.go index 46ca40fd..1a82bfa3 100644 --- a/backend/app/store/engine/bolt_test.go +++ b/backend/app/store/engine/bolt_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - bolt "go.etcd.io/bbolt" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + bolt "go.etcd.io/bbolt" "github.com/umputun/remark/backend/app/store" ) diff --git a/backend/app/store/image/bolt_store.go b/backend/app/store/image/bolt_store.go index 85ed3292..c2f1889c 100644 --- a/backend/app/store/image/bolt_store.go +++ b/backend/app/store/image/bolt_store.go @@ -7,9 +7,9 @@ import ( "path" "time" - bolt "go.etcd.io/bbolt" log "github.com/go-pkgz/lgr" "github.com/pkg/errors" + bolt "go.etcd.io/bbolt" ) const imagesStagedBktName = "imagesStaged" diff --git a/backend/app/store/service/service_test.go b/backend/app/store/service/service_test.go index 1501713a..66e5959b 100644 --- a/backend/app/store/service/service_test.go +++ b/backend/app/store/service/service_test.go @@ -15,12 +15,12 @@ import ( "testing" "time" - bolt "go.etcd.io/bbolt" "github.com/go-pkgz/lgr" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + bolt "go.etcd.io/bbolt" "github.com/umputun/remark/backend/app/store" "github.com/umputun/remark/backend/app/store/admin" diff --git a/backend/app/store/service/tree_test.go b/backend/app/store/service/tree_test.go index 921d3541..8e4c6795 100644 --- a/backend/app/store/service/tree_test.go +++ b/backend/app/store/service/tree_test.go @@ -6,7 +6,6 @@ import ( "testing" "time" - log "github.com/go-pkgz/lgr" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -84,7 +83,7 @@ func TestMakeEmptySubtree(t *testing.T) { res := MakeTree(comments, "time", 0) resJSON, err := json.Marshal(&res) require.NoError(t, err) - log.Print(string(resJSON)) + t.Log(string(resJSON)) expJSON := mustLoadJSONFile(t, "testdata/tree_del.json") assert.Equal(t, string(expJSON), string(resJSON))