Skip to content

GeraAnggaraPutra/go-unit-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unit Test

Commands

go test -v ./...
  • -v → Shows detailed output for each test run
  • ./... → Runs all tests in every folder
go test -v -cover -coverprofile=coverage ./...
  • Shows coverage per function and the overall total
go tool cover -html=coverage
  • Opens the coverage report in the browser
  • Green 🟩 lines = covered code (tested)
  • Red 🟥 lines = code not covered (untested)
  • Gray 🩶 lines = lines not executed directly, such as comments, struct/interface declarations, or function signatures
go tool cover -html=coverage -o coverage.html
  • Creates coverage.html in the project root

About

Sharing Session NBA

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages