From def57f1f884812428340c5a1ec5b891223e8c919 Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Tue, 21 May 2019 15:43:33 +0200 Subject: [PATCH] Switch to Go modules (#7) --- .travis.yml | 10 ++++----- README.md | 26 ++++++++++------------ glide.lock | 62 ----------------------------------------------------- glide.yaml | 8 ------- go.mod | 12 +++++++++++ go.sum | 28 ++++++++++++++++++++++++ 6 files changed, 56 insertions(+), 90 deletions(-) delete mode 100644 glide.lock delete mode 100644 glide.yaml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.travis.yml b/.travis.yml index 9211e4e..510c082 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go -before_install: curl https://glide.sh/get | sh && glide install -script: go test ./... go: -- 1.10.x -- 1.11.x -- master + - 1.11.x + - 1.12.x +env: + - GO111MODULE=on GOFLAGS=-mod=readonly +install: true diff --git a/README.md b/README.md index 166add9..41b72fe 100644 --- a/README.md +++ b/README.md @@ -24,21 +24,17 @@ crypto library](https://github.com/ProtonMail/crypto). ## Download/Install -1. Run `go get -u github.com/ProtonMail/gopenpgp`, or manually `git clone` this - repository into `$GOPATH/src/github.com/ProtonMail/gopenpgp`. +This package uses [Go Modules](https://github.com/golang/go/wiki/Modules), and +thus requires Go 1.11+. If you're also using Go Modules, simply import it and +start using it (see [Set up](#set-up)). If not, run: -2. [Install Glide](https://github.com/Masterminds/glide#install): +```bash +go get github.com/ProtonMail/gopenpgp # or git clone this repository into the following path +cd $GOPATH/src/github.com/ProtonMail/gopenpgp +GO111MODULE=on go mod vendor +``` - ```bash - curl https://glide.sh/get | sh - ``` - -3. Install dependencies using glide: - - ```bash - cd $GOPATH/src/github.com/ProtonMail/gopenpgp - glide install - ``` +(After that, the code will also work in Go 1.10, but you need Go 1.11 for the `go mod` command.) ## Documentation @@ -57,8 +53,8 @@ Go Mobile wiki: https://github.com/golang/go/wiki/Mobile 4. Install Android SDK and NDK using Android Studio 5. Set env: `export ANDROID_HOME="/AndroidSDK"` (path to your SDK) 6. Init gomobile: `gomobile init -ndk /AndroidSDK/ndk-bundle/` (path to your NDK) - -7. Build examples: +7. Copy Go module dependencies to the vendor directory: `go mod vendor` +8. Build examples: `gomobile build -target=android #or ios` Bind examples: diff --git a/glide.lock b/glide.lock deleted file mode 100644 index 377b167..0000000 --- a/glide.lock +++ /dev/null @@ -1,62 +0,0 @@ -hash: 0e0069ce69a4e3bde6233726f21a880347400808a97c2e6f7a173e4d7daea51c -updated: 2018-09-07T10:20:50.211694+02:00 -imports: -- name: github.com/Sirupsen/logrus - version: 3791101e143bf0f32515ac23e831475684f61229 -- name: golang.org/x/crypto - version: efb430e751f2f00d8d9aedb254fc14ef76954880 - repo: https://github.com/ProtonMail/crypto.git - subpackages: - - bitcurves - - brainpool - - cast5 - - curve25519 - - ed25519 - - ed25519/internal/edwards25519 - - internal/randutil - - internal/syscall/unix - - openpgp - - openpgp/aes/keywrap - - openpgp/armor - - openpgp/clearsign - - openpgp/ecdh - - openpgp/elgamal - - openpgp/errors - - openpgp/internal/algorithm - - openpgp/internal/ecc - - openpgp/internal/encoding - - openpgp/packet - - openpgp/s2k - - rand - - rsa - - ssh/terminal -- name: golang.org/x/sys - subpackages: - - unix - - windows -- name: golang.org/x/text - version: 4ae1256249243a4eb350a9a372e126557f2aa346 - subpackages: - - encoding - - encoding/charmap - - encoding/internal - - encoding/internal/identifier - - transform -- name: github.com/ProtonMail/go-mime - version: dc270ae56b61837aa404c828a14b8ea731167ac0 - repo: https://github.com/ProtonMail/go-mime.git -testImports: - - name: github.com/davecgh/go-spew - version: d8f796af33cc11cb798c1aaeb27a4ebc5099927d - subpackages: - - spew - - name: github.com/pmezard/go-difflib - version: 5d4384ee4fb2527b0a1256a821ebfc92f91efefc - subpackages: - - difflib - - name: github.com/stretchr/testify - version: 34c6fa2dc70986bccbbffcc6130f6920a924b075 - subpackages: - - assert - - name: github.com/golangci/golangci-lint - version: 901cf25e20f86b7e9dc6f73eaba5afbd0cbdc257 diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index 90562f3..0000000 --- a/glide.yaml +++ /dev/null @@ -1,8 +0,0 @@ -package: github.com/ProtonMail/gopenpgp -import: -- package: golang.org/x/crypto - repo: https://github.com/ProtonMail/crypto.git - version: master -- package: github.com/ProtonMail/go-mime - repo: https://github.com/ProtonMail/go-mime.git - version: master diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..86a07f6 --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module github.com/ProtonMail/gopenpgp + +go 1.12 + +require ( + github.com/ProtonMail/go-mime v0.0.0-20190501141126-dc270ae56b61 + github.com/Sirupsen/logrus v0.0.0-20180904202135-3791101e143b // indirect + github.com/stretchr/testify v1.3.0 + golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f +) + +replace golang.org/x/crypto => github.com/ProtonMail/crypto v0.0.0-20190427044656-efb430e751f2 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..2dec009 --- /dev/null +++ b/go.sum @@ -0,0 +1,28 @@ +github.com/ProtonMail/crypto v0.0.0-20190427044656-efb430e751f2 h1:AKtmaNbSAHE/YsFKiizxHLwTizqGYZXuOaAe15Qy8SE= +github.com/ProtonMail/crypto v0.0.0-20190427044656-efb430e751f2/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +github.com/ProtonMail/go-mime v0.0.0-20190501141126-dc270ae56b61 h1:Rq3FDGRLXpMKT80U/sLisP4Z3RCS/gvbX5z6E1LzuYM= +github.com/ProtonMail/go-mime v0.0.0-20190501141126-dc270ae56b61/go.mod h1:L7q2umv/vPG0a62Scd4fdJ+FgEsmmprZYOsSYbOFOeE= +github.com/Sirupsen/logrus v0.0.0-20180904202135-3791101e143b h1:SNwLqnXa0wbgNW0h8glxdFFxVew3eByUHGBc9icKICM= +github.com/Sirupsen/logrus v0.0.0-20180904202135-3791101e143b/go.mod h1:rmk17hk6i8ZSAJkSDa7nOxamrG+SP4P0mm+DAvExv4U= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=