Skip to content

Commit

Permalink
all: remove some unused code
Browse files Browse the repository at this point in the history
Primarily testscript's code to support calling testing.MainStart;
we originally needed that to implement our own deep code coverage,
but thankfully `go test` does that for us automatically now.
  • Loading branch information
mvdan committed May 15, 2023
1 parent 5821053 commit bc1bde8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 91 deletions.
9 changes: 0 additions & 9 deletions gotooltest/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,3 @@ func (e0 *environ) get(name string) string {
}
return ""
}

func (e *environ) set(name, val string) {
*e = append(*e, name+"="+val)
}

func (e *environ) unset(name string) {
// TODO actually remove the name from the environment.
e.set(name, "")
}
34 changes: 0 additions & 34 deletions testscript/exe.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,37 +139,3 @@ func copyBinary(from, to string) error {
_, err = io.Copy(writer, reader)
return err
}

type nopTestDeps struct{}

func (nopTestDeps) MatchString(pat, str string) (result bool, err error) {
return false, nil
}

func (nopTestDeps) StartCPUProfile(w io.Writer) error {
return nil
}

func (nopTestDeps) StopCPUProfile() {}

func (nopTestDeps) WriteProfileTo(name string, w io.Writer, debug int) error {
return nil
}

func (nopTestDeps) ImportPath() string {
return ""
}
func (nopTestDeps) StartTestLog(w io.Writer) {}

func (nopTestDeps) StopTestLog() error {
return nil
}

// Note: WriteHeapProfile is needed for Go 1.10 but not Go 1.11.
func (nopTestDeps) WriteHeapProfile(io.Writer) error {
// Not needed for Go 1.10.
return nil
}

// Note: SetPanicOnExit0 was added in Go 1.16.
func (nopTestDeps) SetPanicOnExit0(bool) {}
48 changes: 0 additions & 48 deletions testscript/exe_go118.go

This file was deleted.

0 comments on commit bc1bde8

Please sign in to comment.