Skip to content

Commit

Permalink
add module-path-main
Browse files Browse the repository at this point in the history
  • Loading branch information
bigwhite committed Apr 3, 2023
1 parent 63c7954 commit 1afba52
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions module-path-main/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module main

go 1.20
5 changes: 5 additions & 0 deletions module-path-main/pkg.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

func Add(a, b int) int {
return a + b
}
12 changes: 12 additions & 0 deletions module-path-main/pkg_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import (
"testing"
)

func TestAdd(t *testing.T) {
n := Add(5, 6)
if n != 11 {
t.Errorf("want 11, got %d\n", n)
}
}

0 comments on commit 1afba52

Please sign in to comment.