Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 129
Good morning! Here's your coding interview problem for today.

Given a real number n, find the square root of n. For example, given n = 9, return 3.

Pull request description:
Day129
Resolves #263.

Patch:
diff --git a/README.md b/README.md
index c554b7c..7e9d9c8 100644
--- a/README.md
+++ b/README.md
@@ -132,3 +132,4 @@ problems from
 * [Day 124](https://github.com/vaskoz/dailycodingproblem-go/issues/255)
 * [Day 125](https://github.com/vaskoz/dailycodingproblem-go/issues/257)
 * [Day 127](https://github.com/vaskoz/dailycodingproblem-go/issues/259)
+* [Day 129](https://github.com/vaskoz/dailycodingproblem-go/issues/263)
diff --git a/day129/problem.go b/day129/problem.go
new file mode 100644
index 0000000..800e6ae
--- /dev/null
+++ b/day129/problem.go
@@ -0,0 +1,8 @@
+package day129
+
+import "math"
+
+// Sqrt is a wrapper for math.Sqrt in the standard library.
+func Sqrt(n float64) float64 {
+	return math.Sqrt(n)
+}


Test patch:
diff --git a/day129/problem_test.go b/day129/problem_test.go
new file mode 100644
index 0000000..c19f1e2
--- /dev/null
+++ b/day129/problem_test.go
@@ -0,0 +1,28 @@
+package day129
+
+import "testing"
+
+var testcases = []struct {
+	n, expected float64
+}{
+	{9.0, 3.0},
+	{36.0, 6.0},
+	{81.0, 9.0},
+}
+
+func TestSqrt(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := Sqrt(tc.n); result != tc.expected {
+			t.Errorf("Expected %v got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkSqrt(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			Sqrt(tc.n)
+		}
+	}
+}