Creating Well _tested Application in Go

First of all we have a main text file.At the end of file type we add _test.go to show that this file is a test file.

1)Basic Test → to provide that the application is work truely.(TestXxx front name)

2)Benchmark → To work within the specified limits.(name is BenchmarkXxx)

3)Example → to show the name ExampleXxx

Testing In Go

Creating a Regular Test

To create a main math.go file. Secondly create a test file which name is math_test.go .On import code that we can select a source in standart libary. In func code that we show the test subject (t *testing.T) Later we use the Fail method t.Log(“Failed to …) t.Fail()

Code Coverage Basics

if len(nums)==0 {println(“No arguments provided”) return 0 }

ibrahim ÇOBANİ

Show your support

Clapping shows how much you appreciated Salvo Babani⭐️⭐️⭐️⭐️’s story.