Adding --v1-compatible flag to all previously unsupported command line commands (#6521)

In addition to those commands already supported:

* build
* check
* eval
* fmt
* test

support has been added to the following commands:

* `bench`
* `deps`
* `exec`
* `inspect`
* `parse`
* `run` (command `server` and `REPL`)

Fixes: #6520

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
This commit is contained in:
Johan Fylling
2024-01-24 15:42:32 +01:00
committed by GitHub
parent b1261ba828
commit b36151d992
45 changed files with 3724 additions and 164 deletions
+25
View File
@@ -5,6 +5,8 @@
package test
import (
"bytes"
"sync"
"testing"
"time"
)
@@ -20,3 +22,26 @@ func Eventually(t *testing.T, timeout time.Duration, f func() bool) bool {
}
return false
}
type BlockingWriter struct {
m sync.Mutex
buf bytes.Buffer
}
func (w *BlockingWriter) Write(p []byte) (n int, err error) {
w.m.Lock()
defer w.m.Unlock()
return w.buf.Write(p)
}
func (w *BlockingWriter) String() string {
w.m.Lock()
defer w.m.Unlock()
return w.buf.String()
}
func (w *BlockingWriter) Reset() {
w.m.Lock()
defer w.m.Unlock()
w.buf.Reset()
}