Learning GO

This commit is contained in:
Zakaria
2026-08-31 14:57:35 -04:00
commit d307eb2698
19 changed files with 310 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
package hello
import (
"testing"
)
func TestSayHello(t *testing.T) {
subtests := []struct {
items []string
result string
}{
{
result: "Hello, world!",
},
{
items: []string{"Leena"},
result: "Hello, Leena!",
},
{
items: []string{"Zack", "Sami", "Sara"},
result: "Hello, Zack, Sami, Sara!",
},
}
for _, st := range subtests {
if s := Say(st.items); s != st.result {
t.Errorf("wanted %s (%v), got %s", st.result, st.items, s)
}
}
}