Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using golang style for imported package sorting #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package api
import (
"encoding/hex"
"errors"
"net"
"sync"

"github.com/OpenBazaar/spvwallet"
"github.com/OpenBazaar/spvwallet/api/pb"
"github.com/OpenBazaar/wallet-interface"
Expand All @@ -15,8 +18,6 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
"net"
"sync"
)

const Addr = "127.0.0.1:8234"
Expand Down
9 changes: 5 additions & 4 deletions blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ package spvwallet

import (
"errors"
"github.com/btcsuite/btcd/blockchain"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"math/big"
"sort"
"sync"
"time"

"github.com/btcsuite/btcd/blockchain"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
)

// Blockchain settings. These are kindof Bitcoin specific, but not contained in
Expand Down
9 changes: 5 additions & 4 deletions blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"bytes"
"crypto/rand"
"encoding/hex"
"github.com/btcsuite/btcd/blockchain"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"math/big"
"os"
"testing"
"time"

"github.com/btcsuite/btcd/blockchain"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
)

// New chain starting from regtest genesis
Expand Down
3 changes: 2 additions & 1 deletion checkpoints.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package spvwallet

import (
"time"

"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"time"
)

type Checkpoint struct {
Expand Down
9 changes: 5 additions & 4 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import (
"encoding/json"
"errors"
"fmt"
"os"
"strconv"
"strings"
"time"

"github.com/OpenBazaar/jsonpb"
"github.com/OpenBazaar/spvwallet"
"github.com/OpenBazaar/spvwallet/api"
Expand All @@ -16,10 +21,6 @@ import (
"github.com/jessevdk/go-flags"
"golang.org/x/net/context"
"google.golang.org/grpc"
"os"
"strconv"
"strings"
"time"
)

func SetupCli(parser *flags.Parser) {
Expand Down
18 changes: 9 additions & 9 deletions cmd/spvwallet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net"
"net/url"
"os"
"os/signal"
"path"
"strings"
"sync"
"time"

"github.com/OpenBazaar/spvwallet"
"github.com/OpenBazaar/spvwallet/api"
Expand All @@ -24,15 +33,6 @@ import (
"github.com/skratchdot/open-golang/open"
"github.com/yawning/bulb"
"golang.org/x/net/proxy"
"io/ioutil"
"net"
"net/url"
"os"
"os/signal"
"path"
"strings"
"sync"
"time"
)

var parser = flags.NewParser(nil, flags.Default)
Expand Down
11 changes: 6 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package spvwallet

import (
"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg"
"github.com/mitchellh/go-homedir"
"github.com/op/go-logging"
"golang.org/x/net/proxy"
"net"
"net/url"
"os"
"path/filepath"
"runtime"
"time"

"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg"
"github.com/mitchellh/go-homedir"
"github.com/op/go-logging"
"golang.org/x/net/proxy"
)

type Config struct {
Expand Down
6 changes: 4 additions & 2 deletions db/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package db

import (
"database/sql"
"github.com/OpenBazaar/wallet-interface"
_ "github.com/mattn/go-sqlite3"
"path"
"sync"
"time"

"github.com/OpenBazaar/wallet-interface"

_ "github.com/mattn/go-sqlite3"
)

// This database is mostly just an example implementation used for testing.
Expand Down
5 changes: 3 additions & 2 deletions db/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/btcec"
"math/rand"
"strconv"
"sync"

"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/btcec"
)

type KeysDB struct {
Expand Down
5 changes: 3 additions & 2 deletions db/keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
"crypto/rand"
"database/sql"
"encoding/hex"
"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/btcec"
"sync"
"testing"

"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/btcec"
)

var kdb KeysDB
Expand Down
7 changes: 4 additions & 3 deletions db/stxo.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package db
import (
"database/sql"
"encoding/hex"
"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"strconv"
"strings"
"sync"

"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
)

type StxoDB struct {
Expand Down
7 changes: 4 additions & 3 deletions db/stxo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"bytes"
"database/sql"
"encoding/hex"
"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"strconv"
"sync"
"testing"

"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
)

var sxdb StxoDB
Expand Down
5 changes: 3 additions & 2 deletions db/txns.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package db
import (
"bytes"
"database/sql"
"sync"
"time"

"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"sync"
"time"
)

type TxnsDB struct {
Expand Down
3 changes: 2 additions & 1 deletion db/txns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"bytes"
"database/sql"
"encoding/hex"
"github.com/btcsuite/btcd/wire"
"sync"
"testing"
"time"

"github.com/btcsuite/btcd/wire"
)

var txdb TxnsDB
Expand Down
7 changes: 4 additions & 3 deletions db/utxo.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package db
import (
"database/sql"
"encoding/hex"
"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"strconv"
"strings"
"sync"

"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
)

type UtxoDB struct {
Expand Down
7 changes: 4 additions & 3 deletions db/utxo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"bytes"
"database/sql"
"encoding/hex"
"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"strconv"
"sync"
"testing"

"github.com/OpenBazaar/wallet-interface"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
)

var uxdb UtxoDB
Expand Down
5 changes: 3 additions & 2 deletions eight333.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package spvwallet

import (
"net"
"time"

"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
peerpkg "github.com/btcsuite/btcd/peer"
"github.com/btcsuite/btcd/wire"
"net"
"time"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion exchangerates/bitcoinprices.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"net/http"
"reflect"
"strconv"
"strings"
"sync"
"time"

"github.com/op/go-logging"
"golang.org/x/net/proxy"
"strings"
)

const SatoshiPerBTC = 100000000
Expand Down
5 changes: 3 additions & 2 deletions fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package spvwallet

import (
"encoding/json"
"github.com/OpenBazaar/wallet-interface"
"golang.org/x/net/proxy"
"net"
"net/http"
"time"

"github.com/OpenBazaar/wallet-interface"
"golang.org/x/net/proxy"
)

type httpClient interface {
Expand Down
3 changes: 2 additions & 1 deletion fees_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package spvwallet

import (
"bytes"
"github.com/OpenBazaar/wallet-interface"
"net/http"
"testing"

"github.com/OpenBazaar/wallet-interface"
)

type ClosingBuffer struct {
Expand Down
5 changes: 3 additions & 2 deletions gui/bootstrap/run.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package bootstrap

import (
"os"
"path/filepath"

"github.com/asticode/go-astilectron"
"github.com/asticode/go-astilog"
"github.com/pkg/errors"
"os"
"path/filepath"
)

func Asset(src string) ([]byte, error) {
Expand Down
3 changes: 1 addition & 2 deletions gui/bootstrap/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package bootstrap
import (
"net"
"net/http"
"text/template"

"path/filepath"
"text/template"

"github.com/asticode/go-astilog"
"github.com/asticode/go-astitools/template"
Expand Down
2 changes: 1 addition & 1 deletion headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"math/big"
"path"
"sort"
"strings"
"sync"

"github.com/boltdb/bolt"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/cevaris/ordered_map"
"strings"
)

const (
Expand Down
Loading