From 943d70170d75ebb007142c982906cd3d24406b16 Mon Sep 17 00:00:00 2001 From: PeanutBrrutter Date: Thu, 9 May 2024 10:58:13 +0800 Subject: [PATCH] added hello world --- go.mod | 5 +++++ go.sum | 2 ++ hello.go | 5 +++++ hello_test.go | 16 ++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 go.mod create mode 100644 go.sum create mode 100644 hello.go create mode 100644 hello_test.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..6a20927 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module EduSync + +go 1.22.3 + +require github.com/franela/goblin v0.0.0-20211003143422-0a4f594942bf diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..675ddcc --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/franela/goblin v0.0.0-20211003143422-0a4f594942bf h1:NrF81UtW8gG2LBGkXFQFqlfNnvMt9WdB46sfdJY4oqc= +github.com/franela/goblin v0.0.0-20211003143422-0a4f594942bf/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= diff --git a/hello.go b/hello.go new file mode 100644 index 0000000..fb77d0e --- /dev/null +++ b/hello.go @@ -0,0 +1,5 @@ +package main + +func hello() string { + return "Hello World!" +} diff --git a/hello_test.go b/hello_test.go new file mode 100644 index 0000000..48ba67b --- /dev/null +++ b/hello_test.go @@ -0,0 +1,16 @@ +package main + +import ( + "testing" + + . "github.com/franela/goblin" +) + +func TestHello(t *testing.T) { + g := Goblin(t) + g.Describe("Hello", func() { + g.It("Should print hello world", func() { + g.Assert(hello()).Equal("Hello World!") + }) + }) +}