https://github.com/stnc/my_go_test
golang test library and example list
https://github.com/stnc/my_go_test
Last synced: 11 months ago
JSON representation
golang test library and example list
- Host: GitHub
- URL: https://github.com/stnc/my_go_test
- Owner: stnc
- Created: 2023-07-15T08:06:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-15T07:54:45.000Z (almost 3 years ago)
- Last Synced: 2025-02-22T22:43:26.618Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 16.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# my_go_test
# command list
## how complete (html output )
``` go test -coverprofile=coverage.out ```
## how complete (html output open to web browser)
``` go tool cover -html=coverage.out ```
## how complete (percentile)
``` go test -cover . ```
``` go run ./cmd/web ```
## only single go page
``` go test -timeout 30s -run ^Test_application_handlers$ webapp/cmd/web ```
``` go test -timeout 30s -v -run TestAdd```
``` go test -run TestAdd ./chapter02/calculator -v ```
```go
// Convert2Err error to string
func Convert2Err(err error) string {
byteData := []byte(fmt.Sprintf("%v", err))
return string(byteData)
}
err error
err = fmt.Errorf("reqRoot.Context.System.ApiEndpoint is empty")
```