Merge pull request #1354 from cfromknecht/go-modules

build: Migrate to go modules
This commit is contained in:
Olaoluwa Osuntokun 2018-11-29 17:59:35 -08:00 committed by GitHub
commit 7d2daa5bfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 126 deletions

View file

@ -1,17 +1,19 @@
language: go language: go
cache:
directories:
- $GOCACHE
- $GOPATH
- $GOPATH/pkg/mod
- $GOPATH/github.com/golang
- $GOPATH/gopkg.in/alecthomas
go: go:
- "1.9.5" - "1.11.x"
- "1.10.1"
sudo: false sudo: false
install: install:
- GLIDE_TAG=v0.12.3
- GLIDE_DOWNLOAD="https://github.com/Masterminds/glide/releases/download/$GLIDE_TAG/glide-$GLIDE_TAG-linux-amd64.tar.gz"
- curl -L $GLIDE_DOWNLOAD | tar -xvz
- export PATH=$PATH:$PWD/linux-amd64/ - export PATH=$PATH:$PWD/linux-amd64/
- glide install - GO111MODULE=on go install . ./cmd/...
- go install . ./cmd/... - GO111MODULE=off go get -u gopkg.in/alecthomas/gometalinter.v2
- go get -u gopkg.in/alecthomas/gometalinter.v2 - GO111MODULE=off gometalinter.v2 --install
- gometalinter.v2 --install
script: script:
- export PATH=$PATH:$HOME/gopath/bin - export PATH=$PATH:$HOME/gopath/bin
- ./goclean.sh - ./goclean.sh

View file

@ -35,7 +35,7 @@ which are both under active development.
## Requirements ## Requirements
[Go](http://golang.org) 1.8 or newer. [Go](http://golang.org) 1.11 or newer.
## Installation ## Installation
@ -63,11 +63,8 @@ recommended that `GOPATH` is set to a directory in your home directory such as
- Run the following commands to obtain btcd, all dependencies, and install it: - Run the following commands to obtain btcd, all dependencies, and install it:
```bash ```bash
$ go get -u github.com/Masterminds/glide
$ git clone https://github.com/btcsuite/btcd $GOPATH/src/github.com/btcsuite/btcd
$ cd $GOPATH/src/github.com/btcsuite/btcd $ cd $GOPATH/src/github.com/btcsuite/btcd
$ glide install $ GO111MODULE=on go install -v . ./cmd/...
$ go install . ./cmd/...
``` ```
- btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did - btcd (and utilities) will now be installed in ```$GOPATH/bin```. If you did
@ -86,8 +83,8 @@ Install a newer MSI
```bash ```bash
$ cd $GOPATH/src/github.com/btcsuite/btcd $ cd $GOPATH/src/github.com/btcsuite/btcd
$ git pull && glide install $ git pull
$ go install . ./cmd/... $ GO111MODULE=on go install -v . ./cmd/...
``` ```
## Getting Started ## Getting Started

64
glide.lock generated
View file

@ -1,64 +0,0 @@
hash: 4d4efdd452d746ef15b66d35caadb3cbd58bb299e9c1f5172e90b2f3f272863f
updated: 2018-08-23T22:38:49.421147894-07:00
imports:
- name: github.com/aead/siphash
version: 83563a290f60225eb120d724600b9690c3fb536f
- name: github.com/btcsuite/btclog
version: 84c8d2346e9fc8c7b947e243b9c24e6df9fd206a
- name: github.com/btcsuite/btcutil
version: ab6388e0c60ae4834a1f57511e20c17b5f78be4b
subpackages:
- base58
- bech32
- bloom
- gcs
- gcs/builder
- hdkeychain
- name: github.com/btcsuite/go-socks
version: 4720035b7bfd2a9bb130b1c184f8bbe41b6f0d0f
subpackages:
- socks
- name: github.com/btcsuite/goleveldb
version: 7834afc9e8cd15233b6c3d97e12674a31ca24602
subpackages:
- leveldb
- leveldb/cache
- leveldb/comparer
- leveldb/errors
- leveldb/filter
- leveldb/iterator
- leveldb/journal
- leveldb/memdb
- leveldb/opt
- leveldb/storage
- leveldb/table
- leveldb/util
- name: github.com/btcsuite/snappy-go
version: 0bdef8d067237991ddaa1bb6072a740bc40601ba
- name: github.com/btcsuite/websocket
version: 31079b6807923eb23992c421b114992b95131b55
- name: github.com/btcsuite/winsvc
version: f8fb11f83f7e860e3769a08e6811d1b399a43722
subpackages:
- eventlog
- mgr
- registry
- svc
- winapi
- name: github.com/davecgh/go-spew
version: ecdeabc65495df2dec95d7c4a4c3e021903035e5
subpackages:
- spew
- name: github.com/jessevdk/go-flags
version: 1679536dcc895411a9f5848d9a0250be7856448c
- name: github.com/jrick/logrotate
version: a93b200c26cbae3bb09dd0dc2c7c7fe1468a034a
subpackages:
- rotator
- name: github.com/kkdai/bstream
version: f391b8402d23024e7c0f624b31267a89998fca95
- name: golang.org/x/crypto
version: 9419663f5a44be8b34ca85f08abc5fe1be11f8a3
subpackages:
- ripemd160
testImports: []

View file

@ -1,37 +0,0 @@
package: github.com/btcsuite/btcd
import:
- package: github.com/btcsuite/btclog
- package: github.com/btcsuite/btcutil
version: ab6388e0c60ae4834a1f57511e20c17b5f78be4b
subpackages:
- bloom
- hdkeychain
- package: github.com/btcsuite/go-socks
subpackages:
- socks
- package: golang.org/x/crypto
subpackages:
- ripemd160
- package: github.com/btcsuite/goleveldb
subpackages:
- leveldb
- leveldb/comparer
- leveldb/errors
- leveldb/filter
- leveldb/iterator
- leveldb/opt
- leveldb/util
- package: github.com/btcsuite/websocket
- package: github.com/btcsuite/winsvc
subpackages:
- eventlog
- mgr
- svc
- package: github.com/davecgh/go-spew
subpackages:
- spew
- package: github.com/jessevdk/go-flags
version: 1679536dcc895411a9f5848d9a0250be7856448c
- package: github.com/jrick/logrotate
- package: github.com/aead/siphash
version: 83563a290f60225eb120d724600b9690c3fb536f

17
go.mod Normal file
View file

@ -0,0 +1,17 @@
module github.com/btcsuite/btcd
require (
github.com/aead/siphash v1.0.1
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792
github.com/btcsuite/winsvc v1.0.0
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89
github.com/jrick/logrotate v1.0.0
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44
)

25
go.sum Normal file
View file

@ -0,0 +1,25 @@
github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a h1:RQMUrEILyYJEoAT34XS/kLu40vC0+po/UfxrBBA4qZE=
github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw=
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd h1:qdGvebPBDuYDPGi1WCPjy1tGyMpmDK8IEapSsszn7HE=
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723 h1:ZA/jbKoGcVAnER6pCHPEkGdZOV7U1oLUedErBHCUMs0=
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc=
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495 h1:6IyqGr3fnd0tM3YxipK27TUskaOVUjU2nG45yzwcQKY=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89 h1:12K8AlpT0/6QUXSfV0yi4Q0jkbq8NDtIKFtF61AoqV0=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44 h1:9lP3x0pW80sDI6t1UMSLA4to18W7R7imwAI/sWS9S8Q=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=

View file

@ -11,13 +11,6 @@
set -ex set -ex
# Make sure glide is installed and $GOPATH/bin is in your path.
# $ go get -u github.com/Masterminds/glide
# $ glide install
if [ ! -x "$(type -p glide)" ]; then
exit 1
fi
# Make sure gometalinter is installed and $GOPATH/bin is in your path. # Make sure gometalinter is installed and $GOPATH/bin is in your path.
# $ go get -v github.com/alecthomas/gometalinter" # $ go get -v github.com/alecthomas/gometalinter"
# $ gometalinter --install" # $ gometalinter --install"
@ -25,7 +18,7 @@ if [ ! -x "$(type -p gometalinter.v2)" ]; then
exit 1 exit 1
fi fi
linter_targets=$(glide novendor) linter_targets=$(go list ./...)
# Automatic checks # Automatic checks
test -z "$(gometalinter.v2 -j 4 --disable-all \ test -z "$(gometalinter.v2 -j 4 --disable-all \
@ -35,4 +28,4 @@ test -z "$(gometalinter.v2 -j 4 --disable-all \
--enable=gosimple \ --enable=gosimple \
--enable=unconvert \ --enable=unconvert \
--deadline=10m $linter_targets 2>&1 | grep -v 'ALL_CAPS\|OP_' 2>&1 | tee /dev/stderr)" --deadline=10m $linter_targets 2>&1 | grep -v 'ALL_CAPS\|OP_' 2>&1 | tee /dev/stderr)"
go test -tags rpctest $linter_targets GO111MODULE=on go test -tags="rpctest" $linter_targets