Skip to content

Learn GO topics for beginners and professionals. πŸƒ

Notifications You must be signed in to change notification settings

abhinna1/LearnGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LearnGo

Open-Source public repository to learn GO.

Content

  1. Variables πŸ—ƒοΈ
  2. Conditional Statements πŸ€”
  3. Functions πŸ“²
  4. Packages πŸ“¦
  5. Scope πŸ”­

Code examples

Code examples for different topics are available inside the tutorials package. These examples cover various titles revolving the syntax and concepts in Go.

Tests

Unit-tests are a vital part of any project. Each package in this project contains one or multiple test files with names in the format *_test.go which have the unit-tests for all code examples and packages in the project.

The tests can be debugged in VS-Code or through the cli command go test ./tutorials/....

This command will run all the tests available in the tests module. However, if you want to run any particular test file, you can run go test ./tutorials/package/filename_test.go

You can also add other arguments along with the tests.

  • go test ./tests -v: additional details of the tests.
  • go test ./tests -cover: coverage of the tests.

Coverage

Test coverage is an essential part of this project to ensure the code quality. You can view the coverage of the test cases by adding a -cover argument while running the test cases.

Additionally, you can also generate a coverage report file with the -coverprofile ./coverage.out argument. This creates a coverage.out file in the project root. You can then use this file to visually represent the test coverage in the web-browser with the command go tool cover -html=coverage.out.

NOTE: The coverage report should be ignored if you want to contribute to the project so make sure to strictly name your report file as coverage.out as it is included in the gitignore file. Additionally, it is mandatory for all the packages and contributions to have a 100% code coverage for a successful contribution.

About

Learn GO topics for beginners and professionals. πŸƒ

Topics

Resources

Stars

Watchers

Forks

Languages