Skip to content

Commit 1afba52

Browse files
committed
add module-path-main
1 parent 63c7954 commit 1afba52

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

module-path-main/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module main
2+
3+
go 1.20

module-path-main/pkg.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 Add(a, b int) int {
4+
return a + b
5+
}

module-path-main/pkg_test.go

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

0 commit comments

Comments
 (0)