Skip to content

Commit

Permalink
chore: goimports everything (to trigger the CI)
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <[email protected]>
  • Loading branch information
moul committed Jul 16, 2020
1 parent 5c8bc0f commit 0d1adf0
Show file tree
Hide file tree
Showing 27 changed files with 64 additions and 60 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
golang:
- 1.13
#- 1.13
- 1.14
#- tip
env:
Expand All @@ -50,12 +50,16 @@ jobs:
go mod tidy -v
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum
- name: List packages
run: go list ./...
- name: Build tests
run: go test -i ./...
- name: Run tests with race, without goleak
run: go test -race -covermode=atomic -coverpkg=all -coverprofile=coverage.txt -cover -v ./... -test.timeout=10m
- name: Run tests without options
run: go test ./... -v -test.timeout=15m
- name: Run tests with race and cover
run: go test ./... -race -covermode=atomic -coverpkg=all -coverprofile=coverage.txt -cover -v -test.timeout=15m
# temporarily disabled, because not stable enough
#- name: Run tests without race, with goleak
#- name: Run tests with goleak
# run: go test -v -tags=goleak -test.timeout=10m ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ lint:

.PHONY: test
test:
go test -race -cover -coverprofile=coverage.txt -covermode=atomic -v ./... -timeout 599s # circleci has a built-in 10 minute no-output timeout
go test -race -cover -coverprofile=coverage.txt -covermode=atomic -v ./... -timeout 599s
3 changes: 2 additions & 1 deletion accesscontroller/interface.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package accesscontroller

import (
"context"

"berty.tech/go-ipfs-log/accesscontroller"
"berty.tech/go-ipfs-log/iface"
"context"

"berty.tech/go-orbit-db/events"
"go.uber.org/zap"
Expand Down
2 changes: 1 addition & 1 deletion accesscontroller/ipfs/accesscontroller_ipfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"berty.tech/go-orbit-db/address"
"berty.tech/go-orbit-db/events"
"berty.tech/go-orbit-db/iface"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
cbornode "github.com/ipfs/go-ipld-cbor"
coreapi "github.com/ipfs/interface-go-ipfs-core"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion accesscontroller/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync"

"berty.tech/go-ipfs-log/io"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
cbornode "github.com/ipfs/go-ipld-cbor"
coreapi "github.com/ipfs/interface-go-ipfs-core"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion accesscontroller/orbitdb/accesscontroller_orbitdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"berty.tech/go-orbit-db/events"
"berty.tech/go-orbit-db/iface"
"berty.tech/go-orbit-db/stores"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
"github.com/pkg/errors"
"go.uber.org/zap"
)
Expand Down
2 changes: 1 addition & 1 deletion accesscontroller/simple/accesscontroller_simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"berty.tech/go-orbit-db/address"
"berty.tech/go-orbit-db/events"
"berty.tech/go-orbit-db/iface"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
"github.com/pkg/errors"
"go.uber.org/zap"
)
Expand Down
5 changes: 3 additions & 2 deletions accesscontroller/utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package utils

import (
"context"

"berty.tech/go-orbit-db/accesscontroller"
"berty.tech/go-orbit-db/iface"
"context"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion address/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path"
"strings"

"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
"github.com/pkg/errors"
)

Expand Down
19 changes: 9 additions & 10 deletions baseorbitdb/orbitdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ import (
idp "berty.tech/go-ipfs-log/identityprovider"
"berty.tech/go-ipfs-log/io"
"berty.tech/go-ipfs-log/keystore"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
leveldb "github.com/ipfs/go-ds-leveldb"
cbornode "github.com/ipfs/go-ipld-cbor"
coreapi "github.com/ipfs/interface-go-ipfs-core"
p2pcore "github.com/libp2p/go-libp2p-core"
"github.com/pkg/errors"
"go.opentelemetry.io/otel/api/trace"
"go.uber.org/zap"

"berty.tech/go-orbit-db/accesscontroller"
acutils "berty.tech/go-orbit-db/accesscontroller/utils"
"berty.tech/go-orbit-db/address"
Expand All @@ -36,6 +26,15 @@ import (
"berty.tech/go-orbit-db/pubsub/pubsubcoreapi"
"berty.tech/go-orbit-db/stores"
"berty.tech/go-orbit-db/utils"
cid "github.com/ipfs/go-cid"
datastore "github.com/ipfs/go-datastore"
leveldb "github.com/ipfs/go-ds-leveldb"
cbornode "github.com/ipfs/go-ipld-cbor"
coreapi "github.com/ipfs/interface-go-ipfs-core"
p2pcore "github.com/libp2p/go-libp2p-core"
"github.com/pkg/errors"
"go.opentelemetry.io/otel/api/trace"
"go.uber.org/zap"
)

// OrbitDB An alias of the type defined in the iface package
Expand Down
2 changes: 1 addition & 1 deletion cache/cacheleveldown/leveldown.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"berty.tech/go-orbit-db/address"
"berty.tech/go-orbit-db/cache"
"github.com/ipfs/go-datastore"
datastore "github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/query"
leveldb "github.com/ipfs/go-ds-leveldb"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion cache/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cache

import (
"berty.tech/go-orbit-db/address"
"github.com/ipfs/go-datastore"
datastore "github.com/ipfs/go-datastore"
"go.uber.org/zap"
)

Expand Down
15 changes: 7 additions & 8 deletions iface/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@ import (
ipfslog "berty.tech/go-ipfs-log"
"berty.tech/go-ipfs-log/identityprovider"
"berty.tech/go-ipfs-log/keystore"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
coreapi "github.com/ipfs/interface-go-ipfs-core"
p2pcore "github.com/libp2p/go-libp2p-core"
"github.com/libp2p/go-libp2p-core/peer"
"go.opentelemetry.io/otel/api/trace"
"go.uber.org/zap"

"berty.tech/go-orbit-db/accesscontroller"
"berty.tech/go-orbit-db/address"
"berty.tech/go-orbit-db/events"
"berty.tech/go-orbit-db/stores/operation"
"berty.tech/go-orbit-db/stores/replicator"
cid "github.com/ipfs/go-cid"
datastore "github.com/ipfs/go-datastore"
coreapi "github.com/ipfs/interface-go-ipfs-core"
p2pcore "github.com/libp2p/go-libp2p-core"
"github.com/libp2p/go-libp2p-core/peer"
"go.opentelemetry.io/otel/api/trace"
"go.uber.org/zap"
)

// CreateDBOptions lists the arguments to create a store
Expand Down
3 changes: 2 additions & 1 deletion orbitdb.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package orbitdb

import (
"context"

"berty.tech/go-orbit-db/accesscontroller/ipfs"
"berty.tech/go-orbit-db/accesscontroller/orbitdb"
"berty.tech/go-orbit-db/accesscontroller/simple"
"berty.tech/go-orbit-db/baseorbitdb"
"berty.tech/go-orbit-db/iface"
"berty.tech/go-orbit-db/stores/eventlogstore"
"berty.tech/go-orbit-db/stores/kvstore"
"context"
coreapi "github.com/ipfs/interface-go-ipfs-core"
"github.com/pkg/errors"
)
Expand Down
15 changes: 7 additions & 8 deletions stores/basestore/base_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ import (
"berty.tech/go-ipfs-log/entry"
"berty.tech/go-ipfs-log/identityprovider"
"berty.tech/go-ipfs-log/io"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
files "github.com/ipfs/go-ipfs-files"
coreapi "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/path"
"github.com/pkg/errors"
"go.uber.org/zap"

"berty.tech/go-orbit-db/accesscontroller"
"berty.tech/go-orbit-db/accesscontroller/simple"
"berty.tech/go-orbit-db/address"
Expand All @@ -29,8 +21,15 @@ import (
"berty.tech/go-orbit-db/stores"
"berty.tech/go-orbit-db/stores/operation"
"berty.tech/go-orbit-db/stores/replicator"
cid "github.com/ipfs/go-cid"
datastore "github.com/ipfs/go-datastore"
files "github.com/ipfs/go-ipfs-files"
coreapi "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/path"
"github.com/pkg/errors"
otkv "go.opentelemetry.io/otel/api/kv"
"go.opentelemetry.io/otel/api/trace"
"go.uber.org/zap"
)

// BaseStore The base of other stores
Expand Down
4 changes: 2 additions & 2 deletions stores/basestore/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"berty.tech/go-ipfs-log/entry"
"berty.tech/go-orbit-db/iface"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
cid "github.com/ipfs/go-cid"
datastore "github.com/ipfs/go-datastore"
files "github.com/ipfs/go-ipfs-files"
"github.com/pkg/errors"
)
Expand Down
3 changes: 2 additions & 1 deletion stores/eventlogstore/index.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package eventlogstore

import (
"sync"

ipfslog "berty.tech/go-ipfs-log"
"berty.tech/go-orbit-db/iface"
"sync"
)

type eventIndex struct {
Expand Down
5 changes: 3 additions & 2 deletions stores/eventlogstore/log.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package eventlogstore

import (
"context"

ipfslog "berty.tech/go-ipfs-log"
"berty.tech/go-ipfs-log/identityprovider"
"berty.tech/go-orbit-db/address"
"berty.tech/go-orbit-db/iface"
"berty.tech/go-orbit-db/stores/basestore"
"berty.tech/go-orbit-db/stores/operation"
"context"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
coreapi "github.com/ipfs/interface-go-ipfs-core"
"github.com/pkg/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion stores/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
ipfslog "berty.tech/go-ipfs-log"
"berty.tech/go-orbit-db/address"
"berty.tech/go-orbit-db/stores/replicator"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
p2pcore "github.com/libp2p/go-libp2p-core"
)

Expand Down
3 changes: 2 additions & 1 deletion stores/operation/operation.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package operation

import (
ipfslog "berty.tech/go-ipfs-log"
"encoding/json"

ipfslog "berty.tech/go-ipfs-log"

"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion stores/replicator/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package replicator

import (
ipfslog "berty.tech/go-ipfs-log"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
)

// EventLoadAdded An event triggered when entries have been added
Expand Down
2 changes: 1 addition & 1 deletion stores/replicator/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"berty.tech/go-ipfs-log/identityprovider"
"berty.tech/go-orbit-db/accesscontroller"
"berty.tech/go-orbit-db/events"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
coreapi "github.com/ipfs/interface-go-ipfs-core"
)

Expand Down
2 changes: 1 addition & 1 deletion stores/replicator/replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

ipfslog "berty.tech/go-ipfs-log"
"berty.tech/go-orbit-db/events"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
"github.com/pkg/errors"
otkv "go.opentelemetry.io/otel/api/kv"
"go.opentelemetry.io/otel/api/trace"
Expand Down
5 changes: 2 additions & 3 deletions tests/create_open_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import (
"path"
"testing"

"berty.tech/go-orbit-db/accesscontroller"

"berty.tech/go-ipfs-log/identityprovider"
"berty.tech/go-ipfs-log/io"
"berty.tech/go-ipfs-log/keystore"
orbitdb "berty.tech/go-orbit-db"
"berty.tech/go-orbit-db/accesscontroller"
"berty.tech/go-orbit-db/stores/operation"
"berty.tech/go-orbit-db/utils"
"github.com/ipfs/go-datastore"
datastore "github.com/ipfs/go-datastore"
leveldb "github.com/ipfs/go-ds-leveldb"
"github.com/polydawn/refmt/cbor"
"github.com/polydawn/refmt/obj/atlas"
Expand Down
3 changes: 1 addition & 2 deletions tests/eventlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import (
"fmt"
"testing"

"github.com/ipfs/go-cid"

orbitdb "berty.tech/go-orbit-db"
"berty.tech/go-orbit-db/stores/operation"
cid "github.com/ipfs/go-cid"
. "github.com/smartystreets/goconvey/convey"
)

Expand Down
3 changes: 1 addition & 2 deletions tests/persistence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import (
"testing"
"time"

. "github.com/smartystreets/goconvey/convey"

orbitdb "berty.tech/go-orbit-db"
"berty.tech/go-orbit-db/stores"
"berty.tech/go-orbit-db/stores/basestore"
"berty.tech/go-orbit-db/stores/operation"
. "github.com/smartystreets/goconvey/convey"
)

func TestPersistence(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion utils/create_db_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path"

"berty.tech/go-ipfs-log/io"
"github.com/ipfs/go-cid"
cid "github.com/ipfs/go-cid"
cbornode "github.com/ipfs/go-ipld-cbor"
coreapi "github.com/ipfs/interface-go-ipfs-core"
"github.com/pkg/errors"
Expand Down

0 comments on commit 0d1adf0

Please sign in to comment.