Skip to content

Commit 41aab7d

Browse files
author
Katrina Owen
authored
Merge pull request #812 from ZapAnton/modules_migrate
Migrated the project to the Go modules for dependency management
2 parents ed1c009 + 8da44ec commit 41aab7d

File tree

7 files changed

+86
-261
lines changed

7 files changed

+86
-261
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ go:
77
- "1.11.x"
88
- tip
99

10-
install:
11-
- go get -u github.com/golang/dep/...
12-
- dep ensure
13-
1410
script:
1511
- ./.travis.gofmt.sh
1612
- go test -cover ./...

CONTRIBUTING.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,28 @@ Exercism would be impossible without people like you being willing to spend time
1010

1111
## Dependencies
1212

13-
You'll need Go version 1.10 or higher. Follow the directions on http://golang.org/doc/install
13+
You'll need Go version 1.11 or higher. Follow the directions on http://golang.org/doc/install
1414

15-
You will also need `dep`, the Go dependency management tool. Follow the directions on https://golang.github.io/dep/docs/installation.html
15+
You will also need to be familiar with the Go `modules` dependency management system. Refer to the [modules wiki page](https://github.com/golang/go/wiki/Modules) to learn more.
1616

1717
## Development
1818

19-
If you've never contributed to a Go project before this is going to feel a little bit foreign.
20-
21-
The TL;DR is: **don't clone your fork**, and it matters where on your filesystem the project gets cloned to.
22-
23-
If you don't care how and why and just want something that works, follow these steps:
19+
A typical development workflow looks like this:
2420

2521
1. [fork this repo on the GitHub webpage][fork]
26-
1. `go get github.com/exercism/cli/exercism`
27-
1. `cd $GOPATH/src/github.com/exercism/cli` (or `cd %GOPATH%\src\github.com\exercism\cli` on Windows)
28-
1. `git remote rename origin upstream`
29-
1. `git remote add origin [email protected]:<your-github-username>/cli.git`
30-
1. `git checkout -b development`
31-
1. `git push -u origin development` (setup where you push to, check it works)
32-
1. `go get -u github.com/golang/dep/cmd/dep`
33-
* depending on your setup, you may need to install `dep` by following the instructions in the [`dep` repo](https://github.com/golang/dep)
34-
1. `dep ensure`
35-
1. `git update-index --assume-unchanged Gopkg.lock` (prevent your dep changes being committed)
22+
1. `cd /path/to/the/development/directory`
23+
1. `git clone https://github.com/<your-github-username>/cli.git`
24+
1. `cd cli`
25+
1. `git remote add upstream https://github.com/exercism/cli.git`
26+
1. Optionally: `git config user.name <your-github-username>` and `git config user.email <your-github-email>`
27+
1. `git checkout -b <development-branch-name>`
28+
1. `git push -u origin <development-branch-name>` (setup where you push to, check it works)
29+
30+
Then make your desired changes and submit a pull request. Please provide tests for the changes where possible.
3631

37-
Then make changes as usual and submit a pull request. Please provide tests for the changes where possible.
32+
Please note that if your development directory is located inside the `GOPATH`, you would need to set the `GO111MODULE=on` environment variable, in order to be able to use the `modules` system.
3833

39-
If you care about the details, check out the blog post [Contributing to Open Source Repositories in Go][contrib-blog] on the Splice blog.
34+
If you wish to learn how to contribute to the Go projects without the `modules`, check out the blog post [Contributing to Open Source Repositories in Go][contrib-blog] on the Splice blog.
4035

4136
## Running the Tests
4237

@@ -56,12 +51,12 @@ damaging your real Exercism submissions, or test different tokens, etc.
5651

5752
On Unices:
5853

59-
- `cd $GOPATH/src/github.com/exercism/cli/exercism && go build -o testercism main.go`
54+
- `cd /path/to/the/development/directory/cli && go build -o testercism main.go`
6055
- `./testercism -h`
6156

6257
On Windows:
6358

64-
- `cd /d %GOPATH%\src\github.com\exercism\cli`
59+
- `cd /d \path\to\the\development\directory\cli`
6560
- `go build -o testercism.exe exercism\main.go`
6661
- `testercism.exe —h`
6762

Gopkg.lock

Lines changed: 0 additions & 184 deletions
This file was deleted.

Gopkg.toml

Lines changed: 0 additions & 50 deletions
This file was deleted.

appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ clone_folder: c:\gopath\src\github.com\exercism\cli
55

66
environment:
77
GOPATH: c:\gopath
8+
GO111MODULE: on
89

910
init:
1011
- git config --global core.autocrlf input
@@ -14,8 +15,6 @@ install:
1415
- echo %GOPATH%
1516
- go version
1617
- go env
17-
- go get -u github.com/golang/dep/...
18-
- c:\gopath\bin\dep.exe ensure
1918

2019
build_script:
2120
- go test -cover ./...

go.mod

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module github.com/exercism/cli
2+
3+
require (
4+
github.com/blang/semver v3.5.1+incompatible
5+
github.com/davecgh/go-spew v1.1.0
6+
github.com/fsnotify/fsnotify v1.4.2
7+
github.com/hashicorp/hcl v0.0.0-20170509225359-392dba7d905e
8+
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf
9+
github.com/inconshreveable/mousetrap v1.0.0
10+
github.com/magiconair/properties v1.7.3
11+
github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992
12+
github.com/pelletier/go-buffruneio v0.2.0
13+
github.com/pelletier/go-toml v1.0.0
14+
github.com/pmezard/go-difflib v1.0.0
15+
github.com/spf13/afero v0.0.0-20170217164146-9be650865eab
16+
github.com/spf13/cast v1.1.0
17+
github.com/spf13/cobra v0.0.0-20170731170427-b26b538f6930
18+
github.com/spf13/jwalterweatherman v0.0.0-20170523133247-0efa5202c046
19+
github.com/spf13/pflag v1.0.0
20+
github.com/spf13/viper v0.0.0-20180507071007-15738813a09d
21+
github.com/stretchr/testify v1.1.4
22+
golang.org/x/net v0.0.0-20170726083632-f5079bd7f6f7
23+
golang.org/x/sys v0.0.0-20170803140359-d8f5ea21b929
24+
golang.org/x/text v0.0.0-20170730040918-3bd178b88a81
25+
gopkg.in/yaml.v2 v2.0.0-20170721122051-25c4ec802a7d
26+
)

go.sum

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
2+
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
3+
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
4+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/fsnotify/fsnotify v1.4.2 h1:v5tKwtf2hNhBV24eNYfQ5UmvFOGlOCmRqk7/P1olxtk=
6+
github.com/fsnotify/fsnotify v1.4.2/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
7+
github.com/hashicorp/hcl v0.0.0-20170509225359-392dba7d905e h1:KJWs1uTCkN3E/J5ofCH9Pf8KKsibTFc3fv0CA9+WsVo=
8+
github.com/hashicorp/hcl v0.0.0-20170509225359-392dba7d905e/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
9+
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf h1:WfD7VjIE6z8dIvMsI4/s+1qr5EL+zoIGev1BQj1eoJ8=
10+
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf/go.mod h1:hyb9oH7vZsitZCiBt0ZvifOrB+qc8PS5IiilCIb87rg=
11+
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
12+
github.com/magiconair/properties v1.7.3 h1:6AOjgCKyZFMG/1yfReDPDz3CJZPxnYk7DGmj2HtyF24=
13+
github.com/magiconair/properties v1.7.3/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
14+
github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992 h1:W7VHAEVflA5/eTyRvQ53Lz5j8bhRd1myHZlI/IZFvbU=
15+
github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
16+
github.com/pelletier/go-buffruneio v0.2.0 h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA=
17+
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
18+
github.com/pelletier/go-toml v1.0.0 h1:QFDlmAXZrfPXEF6c9+15fMqhQIS3O0pxszhnk936vg4=
19+
github.com/pelletier/go-toml v1.0.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
20+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
21+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
22+
github.com/spf13/afero v0.0.0-20170217164146-9be650865eab h1:IVAbBHQR8rXL2Fc8Zba/lMF7KOnTi70lqdx91UTuAwQ=
23+
github.com/spf13/afero v0.0.0-20170217164146-9be650865eab/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
24+
github.com/spf13/cast v1.1.0 h1:0Rhw4d6C8J9VPu6cjZLIhZ8+aAOHcDvGeKn+cq5Aq3k=
25+
github.com/spf13/cast v1.1.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg=
26+
github.com/spf13/cobra v0.0.0-20170731170427-b26b538f6930 h1:uJND9FKkf5s8kdTQX1jDygtp/zV4BJQpYvOmXPCYWgc=
27+
github.com/spf13/cobra v0.0.0-20170731170427-b26b538f6930/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
28+
github.com/spf13/jwalterweatherman v0.0.0-20170523133247-0efa5202c046 h1:RpxSq53NruItMGgp6q5MsDYoZynisJgEpisQdWJ7PyM=
29+
github.com/spf13/jwalterweatherman v0.0.0-20170523133247-0efa5202c046/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
30+
github.com/spf13/pflag v1.0.0 h1:oaPbdDe/x0UncahuwiPxW1GYJyilRAdsPnq3e1yaPcI=
31+
github.com/spf13/pflag v1.0.0/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
32+
github.com/spf13/viper v0.0.0-20180507071007-15738813a09d h1:pIz+bbPLk78K39d3u77IlNpJvpS/f0ao8n3sdy82eCs=
33+
github.com/spf13/viper v0.0.0-20180507071007-15738813a09d/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=
34+
github.com/stretchr/testify v1.1.4 h1:ToftOQTytwshuOSj6bDSolVUa3GINfJP/fg3OkkOzQQ=
35+
github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
36+
golang.org/x/net v0.0.0-20170726083632-f5079bd7f6f7 h1:1Pw+ZX4dmGORIwGkTwnUr7RFuMhfpCYHXRZNF04XPYs=
37+
golang.org/x/net v0.0.0-20170726083632-f5079bd7f6f7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
38+
golang.org/x/sys v0.0.0-20170803140359-d8f5ea21b929 h1:M4VPQYSW/nB4Bcg1XMD4yW2sprnwerD3Kb6apRphtZw=
39+
golang.org/x/sys v0.0.0-20170803140359-d8f5ea21b929/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
40+
golang.org/x/text v0.0.0-20170730040918-3bd178b88a81 h1:7aXI3TQ9sZ4JdDoIDGjxL6G2mQxlsPy9dySnJaL6Bdk=
41+
golang.org/x/text v0.0.0-20170730040918-3bd178b88a81/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
42+
gopkg.in/yaml.v2 v2.0.0-20170721122051-25c4ec802a7d h1:2DX7x6HUDGZUyuEDAhUsQQNqkb1zvDyKTjVoTdzaEzo=
43+
gopkg.in/yaml.v2 v2.0.0-20170721122051-25c4ec802a7d/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=

0 commit comments

Comments
 (0)