this repo has no description

:sparkles: (Go) working with integers and creating example documentation for fn

Changed files
+26
Go
+5
Go/integers/adder.go
··· 1 + package integers 2 + 3 + func Add(x, y int) int { 4 + return x + y 5 + }
+21
Go/integers/adder_test.go
··· 1 + package integers 2 + 3 + import ( 4 + "testing" 5 + "fmt" 6 + ) 7 + 8 + func TestAdd(t *testing.T) { 9 + sum := Add(2, 2) 10 + expected := 4 11 + 12 + if sum != expected { 13 + t.Errorf("expected '%d' but got '%d'", expected, sum) 14 + } 15 + } 16 + 17 + func ExampleAdd() { 18 + sum := Add(1, 5) 19 + fmt.Println(sum) 20 + // Output: 6 21 + }