Skip to content

Commit 0718693

Browse files
committedFeb 17, 2023
remove tools.go hack from documentation
1 parent cca66a8 commit 0718693

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed
 

‎docs/index.md

+2-19
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,17 @@ You should now be able to run `ginkgo version` at the command line and see the G
5353
To upgrade Ginkgo run:
5454

5555
```bash
56-
go get github.com/onsi/ginkgo/v2/ginkgo
56+
go get github.com/onsi/ginkgo/v2
5757
go install github.com/onsi/ginkgo/v2/ginkgo
5858
```
5959

6060
To pick a particular version:
6161

6262
```bash
63-
go get github.com/onsi/ginkgo/v2/ginkgo@v2.m.p
63+
go get github.com/onsi/ginkgo/v2@v2.m.p
6464
go install github.com/onsi/ginkgo/v2/ginkgo
6565
```
6666

67-
Note that in both cases we `go get` the `/v2/ginkgo` subpackage. This pulls in the CLI and its dependencies. If you only `go get github.com/onsi/ginkgo/v2` you may experience issues installing the cli - if you do simply run `go get github.com/onsi/ginkgo/v2/ginkgo` to fetch the missing dependencies.
68-
6967
### Support Policy
7068

7169
Ginkgo adheres to semantic versioning - the intent is for there to be no breaking changes along the `2.m.p` line with new functionality landing as minor releases and bug-fixes landing as patch releases (fixes are never back-ported). We work hard to maintain this policy however exceptions (while rare and typically minor) are possible, especially for brand new/emerging features.
@@ -3510,21 +3508,6 @@ When running in CI you must make sure that the version of the `ginkgo` CLI you a
35103508

35113509
`go run github.com/onsi/ginkgo/v2/ginkgo`
35123510

3513-
This alone, however, is often not enough. The Ginkgo CLI includes additional dependencies that aren't part of the Ginkgo library - since your code doesn't import the cli these dependencies probably aren't in your `go.sum` file. To get around this it is idiomatic Go to introduce a `tools.go` file. This can go anywhere in your module - for example, Gomega places its `tools.go` at the top-level. Your `tools.go` file should look like:
3514-
3515-
```go
3516-
//go:build tools
3517-
// +build tools
3518-
3519-
package main
3520-
3521-
import (
3522-
_ "github.com/onsi/ginkgo/v2/ginkgo"
3523-
)
3524-
```
3525-
3526-
The `//go:build tools` constraint ensures this code is never actually built, however the `_ "github.com/onsi/ginkgo/v2/ginkgo` import statement is enough to convince `go mod` to include the Ginkgo CLI dependencies in your `go.sum` file.
3527-
35283511
Once you have `ginkgo` running on CI, you'll want to pick and choose the optimal set of flags for your test runs. We recommend the following set of flags when running in a continuous integration environment:
35293512

35303513
```bash

0 commit comments

Comments
 (0)
Please sign in to comment.