Tsallaka zuwa abun ciki
Justice Tech School

Testing Basics

Tests live in _test.go files and use the testing package. Run them with go test.

Example
package main

import "fmt"

func main() {
	fmt.Println("go test ./...")
}

Result

go test ./...

Exercise

Test file suffix.

file.go

Quiz Test

Which command runs tests?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.