Skip to content

Commit bf49b27

Browse files
committed
add simple test
1 parent f7cd897 commit bf49b27

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v4
1919
with:
20-
go-version: '1.20'
20+
go-version: '1.24'
2121

2222
- name: Cache Go modules
2323
uses: actions/cache@v3

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/javy99/problem-solving-golang
22

3-
go 1.24.2
3+
go 1.24

main/hello.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package main
2+
3+
func Hello() string {
4+
return "Hello, world!"
5+
}

main/hello_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package main
2+
3+
import "testing"
4+
5+
func TestHello(t *testing.T) {
6+
expected := "Hello, world!"
7+
got := Hello()
8+
if got != expected {
9+
t.Errorf("Hello() = %q; want %q", got, expected)
10+
}
11+
}

0 commit comments

Comments
 (0)