-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The test-merging section was failing due to the lack of a test and thus lack of coverage files. This introduces a basic example test project so that this can be demonstrated.
- Loading branch information
1 parent
1eac3c6
commit 811e209
Showing
5 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
module github.com/friendly-fhir/go-template | ||
|
||
go 1.22.3 | ||
|
||
require github.com/google/go-cmp v0.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= | ||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package greeting | ||
|
||
func New() string { | ||
return "Hello, world!" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package greeting_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/friendly-fhir/go-template/internal/greeting" | ||
"github.com/google/go-cmp/cmp" | ||
) | ||
|
||
func TestNew(t *testing.T) { | ||
want := "Hello, world!" | ||
|
||
got := greeting.New() | ||
|
||
if !cmp.Equal(got, want) { | ||
t.Errorf("greeting.New() = %q, want %q", got, want) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
package main | ||
|
||
import "fmt" | ||
import ( | ||
"fmt" | ||
|
||
"github.com/friendly-fhir/go-template/internal/greeting" | ||
) | ||
|
||
func main() { | ||
fmt.Println("Hello, World!") | ||
fmt.Println(greeting.New()) | ||
} |