Skip to content

Commit 31bba03

Browse files
zonrchris-ramon
authored andcommitted
Use Go Modules.
This is done via the following command with Go 1.11: ``` $ go mod init github.com/graphql-go/graphql go: creating new go.mod: module github.com/graphql-go/graphql $ go mod tidy ``` Using Go Modules removes the need to develop/build the project in a `$GOPATH`-based location. More specifically, with latest Go, setting up development environment can be as simple as: ``` /under/whatever/path $ git clone https://github.com/graphql-go/graphql # or your own fork /under/whatever/path $ go test ./... ``` Also instruct CircleCI to run tests with Go Modules when latest Go is in use. See https://circleci.com/blog/go-v1.11-modules-and-circleci/.
1 parent 993e01c commit 31bba03

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

.circleci/config.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,43 @@
1-
defaults: &defaults
1+
test_with_go_modules: &test_with_go_modules
2+
steps:
3+
- checkout
4+
- run: go test ./...
5+
- run: go vet ./...
6+
7+
test_without_go_modules: &test_without_go_modules
28
working_directory: /go/src/github.com/graphql-go/graphql
39
steps:
410
- checkout
511
- run: go get -v -t -d ./...
612
- run: go test ./...
713
- run: go vet ./...
8-
14+
15+
defaults: &defaults
16+
<<: *test_with_go_modules
17+
918
version: 2
1019
jobs:
1120
golang:1.8.7:
12-
<<: *defaults
21+
<<: *test_without_go_modules
1322
docker:
1423
- image: circleci/golang:1.8.7
1524
golang:1.9.7:
16-
<<: *defaults
25+
<<: *test_without_go_modules
1726
docker:
1827
- image: circleci/golang:1.9.7
28+
golang:1.11:
29+
<<: *defaults
30+
docker:
31+
- image: circleci/golang:1.11
1932
golang:latest:
2033
<<: *defaults
2134
docker:
2235
- image: circleci/golang:latest
2336
coveralls:
24-
working_directory: /go/src/github.com/graphql-go/graphql
2537
docker:
2638
- image: circleci/golang:latest
2739
steps:
2840
- checkout
29-
- run: go get -v -t -d ./...
3041
- run: go get github.com/mattn/goveralls
3142
- run: go test -v -cover -race -coverprofile=coverage.out
3243
- run: /go/bin/goveralls -coverprofile=coverage.out -service=circle-ci -repotoken $COVERALLS_TOKEN
@@ -37,5 +48,6 @@ workflows:
3748
jobs:
3849
- golang:1.8.7
3950
- golang:1.9.7
51+
- golang:1.11
4052
- golang:latest
4153
- coveralls

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module github.com/graphql-go/graphql

0 commit comments

Comments
 (0)