diff --git a/001-gno-cli/README.md b/001-gno-cli/README.md new file mode 100644 index 0000000..af8866c --- /dev/null +++ b/001-gno-cli/README.md @@ -0,0 +1,11 @@ +# Getting Started with Gno CLI + +In this section, you will learn to use the `gno` CLI to write and test Gnolang packages. This part does not rely on a blockchain; instead, it operates solely on the GnoVM. + +## Steps + +* Use `gno --help` to explore available commands and options. +* Use `gno test .` to test your Gnolang packages. +* For additional features, explore `gno doc`, etc. + +Enjoy the journey of discovering and mastering the Gno CLI! diff --git a/001-gno-cli/hello.gno b/001-gno-cli/hello.gno new file mode 100644 index 0000000..a8626b3 --- /dev/null +++ b/001-gno-cli/hello.gno @@ -0,0 +1,9 @@ +package hello + +func Sum(a, b int) int { + return a + b +} + +func Greetings(name string) string { + return "Hello " + name + "!" +} diff --git a/001-gno-cli/hello_test.gno b/001-gno-cli/hello_test.gno new file mode 100644 index 0000000..1d7bd9f --- /dev/null +++ b/001-gno-cli/hello_test.gno @@ -0,0 +1,11 @@ +package hello + +import "testing" + +func TestSum(t *testing.T) { + got := Sum(1, 2) + expected := 3 + if got != expected { + t.Errorf("exected %d, got %d", expected, got) + } +}