diff --git a/Makefile b/Makefile index 452144f..d39cdb6 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,11 @@ build-vlang: @ [ ! -d build/build-vlang ] && mkdir build/build-vlang @ v -o build/build-vlang/zernit-vlang src/bin/main.v +build-golang: + @ [ ! -d build ] && mkdir build + @ [ ! -d build/build-golang ] && mkdir build/build-golang + @ go build -o build/build-golang/zernit-golang src/bin/main.go + ## CHECK/TESTS ## check: diff --git a/src/bin/main.go b/src/bin/main.go new file mode 100644 index 0000000..8e251ff --- /dev/null +++ b/src/bin/main.go @@ -0,0 +1,11 @@ +package main + +import "fmt" + +func helloworld() string { + return "Hello World!!" +} + +func main() { + fmt.Println(helloworld()) +} \ No newline at end of file diff --git a/tests/golang/hello_world_test.go b/tests/golang/hello_world_test.go new file mode 100644 index 0000000..c7e32f7 --- /dev/null +++ b/tests/golang/hello_world_test.go @@ -0,0 +1,9 @@ +package main + +import "testing" + +func TestHelloWorld(t *testing.T) { + if helloworld() != "Hello World!!" { + t.Fatal("Test fail") + } +} \ No newline at end of file