Skip to content

Commit 6c48bcd

Browse files
committed
Rewrite import paths to hard fork
This is an issue because this module is currently used via a replace directive in the cli/cli go.mod, which prevents installation via go [email protected]/cli/cli/cmd/gh cli/cli#9818
1 parent fa3c22e commit 6c48bcd

File tree

31 files changed

+66
-64
lines changed

31 files changed

+66
-64
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Why is this forked?
22

3-
This repo is forked into the `cli` org to allow the `gh` maintainers to explore the use of `testscript` in `gh`, while providing the flexibility for us to share modifications and extensions. It is not intended to be a long-term maintained fork and you should not rely on it.
3+
This is hard forked from github.com/rogpeppe/testscript to allow the `gh` maintainers to explore the use of `testscript` in `gh`, while providing the flexibility for us to share modifications and extensions. It is not intended to be a long-term maintained fork and you should not rely on it.
44

5-
## Original README
5+
If we determine it is a good fit for the project, we will decide what to do next based on how our needs align with the preferences of the maintainers of rogpeppe/testscript.
6+
7+
## Original README with minor tweaks to indicate upstream/fork relationship
68

79
This repository factors out an opinionated selection of internal packages and functionality from the Go standard
810
library. Currently this consists mostly of packages and testing code from within the Go tool implementation.
911

10-
This repo is [primarily maintained](https://github.com/rogpeppe/go-internal/graphs/contributors) by long-time
12+
The upstream repo is [primarily maintained](https://github.com/rogpeppe/go-internal/graphs/contributors) by long-time
1113
[Go contributors](https://github.com/golang/go/contributors) who are also currently
1214
[maintaining CUE](https://github.com/cue-lang/cue/graphs/contributors) (which is primarily written in Go
1315
and which relies upon several of the packages here).
@@ -31,18 +33,18 @@ Our package will be replaced by it once https://github.com/golang/go/issues/5926
3133

3234
### testscript
3335

34-
The most popular package here is the [testscript](https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript) package:
36+
The most popular package here is the [testscript](https://pkg.go.dev/github.com/cli/go-internal/testscript) package:
3537
* Provides a shell-like test environment that is very nicely tuned for testing Go CLI commands.
3638
* Extracted from the core Go team's internal testscript package ([cmd/go/internal/script](https://github.com/golang/go/tree/master/src/cmd/go/internal/script)),
3739
which is [heavily used](https://github.com/golang/go/tree/master/src/cmd/go/testdata/script) to test the `go` command.
3840
* Supports patterns for checking stderr/stdout, command pass/fail assertions, and so on.
3941
* Integrates well with `go test`, including coverage support.
4042
* Inputs and sample output files can use the simple [txtar](https://pkg.go.dev/golang.org/x/tools/txtar)
4143
text archive format, also used by the Go playground.
42-
* Allows [automatically updating](https://pkg.go.dev/github.com/rogpeppe/go-internal/testscript#Params)
44+
* Allows [automatically updating](https://pkg.go.dev/github.com/cli/go-internal/testscript#Params)
4345
golden files.
4446
* Built-in support for Go concepts like build tags.
45-
* Accompanied by a [testscript](https://github.com/rogpeppe/go-internal/tree/master/cmd/testscript) command
47+
* Accompanied by a [testscript](https://github.com/cli/go-internal/tree/master/cmd/testscript) command
4648
for running standalone scripts with files embedded in txtar format.
4749

4850
A nice introduction to using testscripts is this [blog post](https://bitfieldconsulting.com/golang/test-scripts) series.

cache/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"strings"
2020
"time"
2121

22-
"github.com/rogpeppe/go-internal/lockedfile"
22+
"github.com/cli/go-internal/lockedfile"
2323
)
2424

2525
// An ActionID is a cache action key, the hash of a complete description of a

cmd/testscript/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
```
2-
The testscript command runs github.com/rogpeppe/go-internal/testscript scripts
2+
The testscript command runs github.com/cli/go-internal/testscript scripts
33
in a fresh temporary work directory tree.
44
55
Usage:
@@ -9,15 +9,15 @@ The testscript command is designed to make it easy to create self-contained
99
reproductions of command sequences.
1010
1111
Each file is opened as a script and run as described in the documentation for
12-
github.com/rogpeppe/go-internal/testscript. The special filename "-" is
12+
github.com/cli/go-internal/testscript. The special filename "-" is
1313
interpreted as the standard input.
1414
1515
As a special case, supporting files/directories in the .gomodproxy subdirectory
16-
will be served via a github.com/rogpeppe/go-internal/goproxytest server which
16+
will be served via a github.com/cli/go-internal/goproxytest server which
1717
is available to each script via the GOPROXY environment variable. The contents
1818
of the .gomodproxy subdirectory are not available to the script except via the
1919
proxy server. See the documentation for
20-
github.com/rogpeppe/go-internal/goproxytest for details on the format of these
20+
github.com/cli/go-internal/goproxytest for details on the format of these
2121
files/directories.
2222
2323
Environment variables can be passed through to each script with the -e flag,

cmd/testscript/help.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func mainUsage(f io.Writer) {
1010
}
1111

1212
var mainHelp = `
13-
The testscript command runs github.com/rogpeppe/go-internal/testscript scripts
13+
The testscript command runs github.com/cli/go-internal/testscript scripts
1414
in a fresh temporary work directory tree.
1515
1616
Usage:
@@ -20,15 +20,15 @@ The testscript command is designed to make it easy to create self-contained
2020
reproductions of command sequences.
2121
2222
Each file is opened as a script and run as described in the documentation for
23-
github.com/rogpeppe/go-internal/testscript. The special filename "-" is
23+
github.com/cli/go-internal/testscript. The special filename "-" is
2424
interpreted as the standard input.
2525
2626
As a special case, supporting files/directories in the .gomodproxy subdirectory
27-
will be served via a github.com/rogpeppe/go-internal/goproxytest server which
27+
will be served via a github.com/cli/go-internal/goproxytest server which
2828
is available to each script via the GOPROXY environment variable. The contents
2929
of the .gomodproxy subdirectory are not available to the script except via the
3030
proxy server. See the documentation for
31-
github.com/rogpeppe/go-internal/goproxytest for details on the format of these
31+
github.com/cli/go-internal/goproxytest for details on the format of these
3232
files/directories.
3333
3434
Environment variables can be passed through to each script with the -e flag,

cmd/testscript/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ import (
1515
"strings"
1616
"sync/atomic"
1717

18-
"github.com/rogpeppe/go-internal/goproxytest"
19-
"github.com/rogpeppe/go-internal/gotooltest"
20-
"github.com/rogpeppe/go-internal/testscript"
18+
"github.com/cli/go-internal/goproxytest"
19+
"github.com/cli/go-internal/gotooltest"
20+
"github.com/cli/go-internal/testscript"
2121
)
2222

2323
const (
2424
// goModProxyDir is the special subdirectory in a txtar script's supporting files
25-
// within which we expect to find github.com/rogpeppe/go-internal/goproxytest
25+
// within which we expect to find github.com/cli/go-internal/goproxytest
2626
// directories.
2727
goModProxyDir = ".gomodproxy"
2828
)

cmd/testscript/main_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
"strings"
1414
"testing"
1515

16-
"github.com/rogpeppe/go-internal/gotooltest"
17-
"github.com/rogpeppe/go-internal/internal/os/execpath"
18-
"github.com/rogpeppe/go-internal/testscript"
16+
"github.com/cli/go-internal/gotooltest"
17+
"github.com/cli/go-internal/internal/os/execpath"
18+
"github.com/cli/go-internal/testscript"
1919
)
2020

2121
func TestMain(m *testing.M) {

cmd/txtar-addmod/addmod.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// license that can be found in the LICENSE file.
44

55
// The txtar-addmod command adds a module as a txtar archive to the a testdata module directory
6-
// as understood by the goproxytest package (see https://godoc.org/github.com/rogpeppe/go-internal/goproxytest).
6+
// as understood by the goproxytest package (see https://godoc.org/github.com/cli/go-internal/goproxytest).
77
//
88
// Usage:
99
//
@@ -38,7 +38,7 @@ func usage() {
3838
fmt.Fprintf(os.Stderr, `
3939
The txtar-addmod command adds a module as a txtar archive to the
4040
testdata module directory as understood by the goproxytest package
41-
(see https://godoc.org/github.com/rogpeppe/go-internal/goproxytest).
41+
(see https://godoc.org/github.com/cli/go-internal/goproxytest).
4242
4343
The dir argument names to directory to add the module to. If dir is "-",
4444
the result will instead be written to the standard output in a form

cmd/txtar-addmod/script_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"os"
1010
"testing"
1111

12-
"github.com/rogpeppe/go-internal/goproxytest"
13-
"github.com/rogpeppe/go-internal/gotooltest"
14-
"github.com/rogpeppe/go-internal/testscript"
12+
"github.com/cli/go-internal/goproxytest"
13+
"github.com/cli/go-internal/gotooltest"
14+
"github.com/cli/go-internal/testscript"
1515
)
1616

1717
var proxyURL string

cmd/txtar-c/savedir.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"strings"
2323
"unicode/utf8"
2424

25-
"github.com/rogpeppe/go-internal/txtar"
25+
"github.com/cli/go-internal/txtar"
2626
)
2727

2828
var flag = stdflag.NewFlagSet(os.Args[0], stdflag.ContinueOnError)

cmd/txtar-c/script_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"os"
99
"testing"
1010

11-
"github.com/rogpeppe/go-internal/testscript"
11+
"github.com/cli/go-internal/testscript"
1212
)
1313

1414
func TestMain(m *testing.M) {

0 commit comments

Comments
 (0)