From 42e57cf79767b0d4a22674388328d13547074cc8 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Sat, 22 Jul 2023 11:16:33 +0200 Subject: [PATCH 1/3] feat: 001-gno-cli Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- 001-gno-cli/README.md | 11 +++++++++++ 001-gno-cli/hello.gno | 9 +++++++++ 001-gno-cli/hello_test.gno | 11 +++++++++++ 3 files changed, 31 insertions(+) create mode 100644 001-gno-cli/README.md create mode 100644 001-gno-cli/hello.gno create mode 100644 001-gno-cli/hello_test.gno diff --git a/001-gno-cli/README.md b/001-gno-cli/README.md new file mode 100644 index 0000000..451b9f2 --- /dev/null +++ b/001-gno-cli/README.md @@ -0,0 +1,11 @@ +# Getting Started / 001-gno-cli + +Learn to use the `gno` CLI to write and test Gnolang packages. +This part is not relying on a blockchain, but just on the GnoVM. + +## Steps + +* TODO: gno --help +* TODO: gno test . +* TODO: gno run (if appropriate) +* TODO: bonus, gno doc, etc (if makes sense) diff --git a/001-gno-cli/hello.gno b/001-gno-cli/hello.gno new file mode 100644 index 0000000..e9e8b44 --- /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..2148a23 --- /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) + } +} From a2b2a82055d1ca12bda2c5fff0ce9a626e6647db Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Sat, 22 Jul 2023 11:19:06 +0200 Subject: [PATCH 2/3] chore: fixup Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- 001-gno-cli/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/001-gno-cli/README.md b/001-gno-cli/README.md index 451b9f2..af8866c 100644 --- a/001-gno-cli/README.md +++ b/001-gno-cli/README.md @@ -1,11 +1,11 @@ -# Getting Started / 001-gno-cli +# Getting Started with Gno CLI -Learn to use the `gno` CLI to write and test Gnolang packages. -This part is not relying on a blockchain, but just on the GnoVM. +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 -* TODO: gno --help -* TODO: gno test . -* TODO: gno run (if appropriate) -* TODO: bonus, gno doc, etc (if makes sense) +* 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! From 5812c8b746352751c14a4b7042305bf17c2fb187 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Sat, 22 Jul 2023 11:25:16 +0200 Subject: [PATCH 3/3] chore: fixup Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- 001-gno-cli/hello.gno | 2 +- 001-gno-cli/hello_test.gno | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/001-gno-cli/hello.gno b/001-gno-cli/hello.gno index e9e8b44..a8626b3 100644 --- a/001-gno-cli/hello.gno +++ b/001-gno-cli/hello.gno @@ -1,7 +1,7 @@ package hello func Sum(a, b int) int { - return a + b + return a + b } func Greetings(name string) string { diff --git a/001-gno-cli/hello_test.gno b/001-gno-cli/hello_test.gno index 2148a23..1d7bd9f 100644 --- a/001-gno-cli/hello_test.gno +++ b/001-gno-cli/hello_test.gno @@ -4,7 +4,7 @@ import "testing" func TestSum(t *testing.T) { got := Sum(1, 2) - expected:= 3 + expected := 3 if got != expected { t.Errorf("exected %d, got %d", expected, got) }