Home >Backend Development >Golang >Why Does 'go test -timeout 99999' Fail, and How Can I Correctly Set a Timeout for Go Tests?
When using go test -timeout 99999, you may encounter the error "invalid value '99999' for flag -test.timeout: time: missing unit in duration 99999". To resolve this issue, it is crucial to provide a valid time.ParseDuration input.
The -timeout flag in the go test command sets an aggregate time limit for all tests. To specify the timeout value, you need to use the correct syntax.
Valid Syntax:
go test -timeout <duration>
Valid Time Units:
Examples of Valid Timeout Values:
Additional Notes:
The above is the detailed content of Why Does 'go test -timeout 99999' Fail, and How Can I Correctly Set a Timeout for Go Tests?. For more information, please follow other related articles on the PHP Chinese website!