refactor: simplify io code and make utils module independent

This commit is contained in:
yusing
2025-05-23 22:19:14 +08:00
parent ff08c40403
commit f1e204f7fd
24 changed files with 124 additions and 73 deletions

View File

@@ -2,14 +2,16 @@ package expect
import (
"os"
"strings"
"testing"
"github.com/stretchr/testify/require"
"github.com/yusing/go-proxy/internal/common"
)
var isTest = strings.HasSuffix(os.Args[0], ".test")
func init() {
if common.IsTest {
if isTest {
// force verbose output
os.Args = append([]string{os.Args[0], "-test.v"}, os.Args[1:]...)
}