Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rogpeppe/go-internal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.8.1
Choose a base ref
...
head repository: rogpeppe/go-internal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.9.0
Choose a head ref
  • 20 commits
  • 41 files changed
  • 6 contributors

Commits on Jan 12, 2022

  1. testscript: print background command output on failure (#148)

    When a script has failed, the output of the commands running in the
    background can be useful to see, so display it then and also in verbose
    mode.
    rogpeppe authored Jan 12, 2022
    Configuration menu
    Copy the full SHA
    dc66b32 View commit details
    Browse the repository at this point in the history
  2. testscript: support named background commands (#152)

    This lets us wait for an individual background command rather
    than all of them at once.
    rogpeppe authored Jan 12, 2022
    Configuration menu
    Copy the full SHA
    f3cb5c2 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2022

  1. testscript: remove errgo dependency (#155)

    There's no need to use it and every dependency lost is good.
    rogpeppe authored Mar 9, 2022
    Configuration menu
    Copy the full SHA
    b66946f View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2022

  1. testscript: tidy up condition logic

    twpayne authored and mvdan committed Mar 12, 2022
    Configuration menu
    Copy the full SHA
    f1aca1d View commit details
    Browse the repository at this point in the history
  2. testscript: add gc and gccgo conditions

    twpayne authored and mvdan committed Mar 12, 2022
    Configuration menu
    Copy the full SHA
    b00b079 View commit details
    Browse the repository at this point in the history
  3. gotooltest: fix Go version regular expression

    Trivia: the first defined Go version build constraint is go1.1.
    twpayne authored and mvdan committed Mar 12, 2022
    Configuration menu
    Copy the full SHA
    635e0f0 View commit details
    Browse the repository at this point in the history
  4. testscript: add go version conditions

    twpayne authored and mvdan committed Mar 12, 2022
    Configuration menu
    Copy the full SHA
    3461ca1 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2022

  1. gotooltest: move default GOPATH out of the main module

    Otherwise, commands like `go mod tidy` will try to walk into the default
    GOPATH directory. At best, that's a waste of resources, since
    directories like GOMODPATH may contain lots of files. At worst, it
    results in errors, as directories in GOMODPATH are not valid import paths:
    
    	--- FAIL: TestScripts/list (0.01s)
    		testscript.go:413:
    			[...]
    			> go mod tidy
    			[stderr]
    			mod/gopath/pkg/mod/fruit.com@v1.1.0/fruit: import path "mod/gopath/pkg/mod/fruit.com@v1.1.0/fruit" should not have @Version
    
    We add the test in goproxytest, as goproxytest already uses gotooltest,
    and we need an external module to reproduce the error.
    mvdan committed Apr 22, 2022
    Configuration menu
    Copy the full SHA
    009359f View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2022

  1. drop Go 1.16, add Go 1.18 (#158)

    While here, bump gotip and the action versions.
    mvdan authored Jun 20, 2022
    Configuration menu
    Copy the full SHA
    3b43157 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2022

  1. testscript: exit 0 in runCoverSubcommand if -help is used

    flag.ExitOnError will exit 0 for -h/-help, while the flag.PanicOnError
    override in runCoverSubcommand was always exiting 2, making the
    success/failure of running a command with -hhelp depend on whether
    coverage is active.
    FiloSottile authored and mvdan committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    e9142ea View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2022

  1. all: add support for txtar extension and prefer it (#159)

    For backwards compatibility, both testscript and goproxytest, which used
    to glob on `*.txt`, now look for both file extensions.
    Note that this required a bit of a refactor in testscript,
    as we cannot use a single glob expression to accomplish this.
    
    Code which produces files, such as txtar-addmod, now produces `*.txtar`
    rather than `*.txt`. Similarly, the public docs now use `*.txtar` too.
    
    Note that we leave many txt files in tests untouched;
    it's unnecessary to change them given the backwards compatibility,
    and it has zero benefit to the user as they aren't public.
    Moreover, the diff churn would make this patch harder to review.
    If a future version of go-internal only supports txtar extensions,
    then it could replace all of those extensions accordingly.
    
    Fixes #126.
    mvdan authored Jun 24, 2022
    Configuration menu
    Copy the full SHA
    af73bbc View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2022

  1. testscript: add Params.RequireExplicitExec

    We also document how top-level commands fed to RunMain work with and
    without "exec" the same way, and how RequireExplicitExec can drop
    backwards compatibility for greater consistency.
    
    Fixes #163.
    mvdan committed Jul 6, 2022
    Configuration menu
    Copy the full SHA
    9d15b66 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2022

  1. imports: add 'UnixOS' list of Unix-like systems

    From Go 1.19, the build constraint 'unix' proposed in golang/go#20322 is
    satisfied by any sufficiently Unix-like value of GOOS, as defined by
    src/go/build/syslist.go. This commit adds a 'UnixOS' list containing the
    values of GOOS that would satisfy the 'unix' constraint in Go 1.19.
    
    Co-authored-by: Paul Jolly <paul@myitcv.io>
    2 people authored and mvdan committed Jul 28, 2022
    Configuration menu
    Copy the full SHA
    8da7db8 View commit details
    Browse the repository at this point in the history
  2. testscript: add 'unix' condition

    From Go 1.19, the build constraint 'unix' proposed in golang/go#20322 is
    satisfied by any sufficiently Unix-like value of GOOS, as defined by
    src/go/build/syslist.go. This commit adds a predefined 'unix' condition
    with the same meaning, available for use in test scripts. The condition
    is satisfied if the target GOOS is one of the list of Unix-like systems
    defined in 'imports.UnixOS'.
    
    Fixes #166.
    
    Co-authored-by: Daniel Martí <mvdan@mvdan.cc>
    bitfield and mvdan committed Jul 28, 2022
    Configuration menu
    Copy the full SHA
    2431384 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2022

  1. testscript: fix RequireExplicitExec error messages

    They used args[0], which is the first argument to the command,
    rather than the command name itself:
    
    	> gofumpt foo.go
    	FAIL: [...] use 'exec foo.go' rather than 'foo.go' (because RequireExplicitExec is enabled)
    
    I believe I introduced this regression when refactoring the pull request
    due to Roger's review, as I moved the code out of TestMain, where
    args[0] was still the name of the command to be run.
    
    Note that I can't easily add a regression test here, because the
    testscript command being used in the tests is not a top-level command
    run as a separate process, so it does not produce stdout nor stderr.
    The change seems easy enough to review manually,
    and our tests don't strictly check all error messages anyway.
    
    While here, remove the unnecessary use of -verbose.
    mvdan committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    bb36173 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2022

  1. testscript: fix RequireExplicitExec error messages

    They used args[0], which is the first argument to the command,
    rather than the command name itself:
    
    	> gofumpt foo.go
    	FAIL: [...] use 'exec foo.go' rather than 'foo.go' (because RequireExplicitExec is enabled)
    
    I believe I introduced this regression when refactoring the pull request
    due to Roger's review, as I moved the code out of TestMain, where
    args[0] was still the name of the command to be run.
    
    Note that I can't easily add a regression test here, because the
    testscript command being used in the tests is not a top-level command
    run as a separate process, so it does not produce stdout nor stderr.
    The change seems easy enough to review manually,
    and our tests don't strictly check all error messages anyway.
    
    While here, remove the unnecessary use of -verbose.
    mvdan committed Aug 4, 2022
    Configuration menu
    Copy the full SHA
    77fe68f View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2022

  1. Trim '.txtar' extension from subtest name

    bitfield authored and mvdan committed Aug 20, 2022
    Configuration menu
    Copy the full SHA
    57a71e0 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2022

  1. Use 0o prefix for octal literals

    bitfield authored and mvdan committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    0d96cbe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c16c0a2 View commit details
    Browse the repository at this point in the history
  3. testscript: update docs on set variables

    We have been setting `/`, `:`, and `$` for some time,
    but they weren't documented. Do that.
    
    `goversion` doesn't belong here, as it was moved to `gotooltest`.
    
    `TMPDIR` was slightly wrong; it has started with a period for some time,
    to ensure that tools like `go list ./...` don't descend into it.
    mvdan committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    7a6a5f8 View commit details
    Browse the repository at this point in the history
Loading