在VScode中具有go擴展名后,對方法進行基準測試只需單擊一下,[run benchmark]然后立即在vscode控制臺中將其輸出,然后是運行的命令和輸出:Running tool: /usr/local/bin/go test -benchmem -run=^$ github.com/zyxan/benchmarks -bench ^BenchmarkRandomStringGeneration2$goos: darwingoarch: amd64pkg: github.com/zyxan/benchmarksBenchmarkRandomStringGeneration2-4 10000000 147 ns/op 80 B/op 3 allocs/opPASSok github.com/zyxan/benchmarks 1.654sSuccess: Benchmarks passed.現在,如果我想在終端上重現這樣的命令,我實際上只是復制它/usr/local/bin/go test -benchmem -run=^$ github.com/zyxan/benchmarks -bench ^BenchmarkRandomStringGeneration2$將其粘貼到我的終端會話中會得到以下輸出:? /usr/local/bin/go test -benchmem -run=^$ github.com/zyxan/benchmarks -bench ^BenchmarkRandomStringGeneration2$zsh: no matches found: -run=^$為什么會引起這種差異?
- 1 回答
- 0 關注
- 271 瀏覽
添加回答
舉報
0/150
提交
取消