Hi Sannyasin,
I found a quick small snippet of some “Hello World” GO code and have listed it
below.
I much prefer LiveCode syntax over this stuff any day.
Stick with LiveCode, it’s just better!
Just my 2 cents for the day.
Cheers,
Rick
Add a test to the stringutil package by creating the
file$GOPATH/src/github.com/user/stringutil/reverse_test.go containing the
following Go code.
package stringutil
import "testing"
func TestReverse(t *testing.T) {
cases := []struct {
in, want string
}{
{"Hello, world", "dlrow ,olleH"},
{"Hello, 世界", "界世 ,olleH"},
{"", ""},
}
for _, c := range cases {
got := Reverse(c.in)
if got != c.want {
t.Errorf("Reverse(%q) == %q, want %q", c.in, got,
c.want)
}
}
}
Then run the test with go test:
$ go test github.com/user/stringutil
ok github.com/user/stringutil 0.165s
> On Jun 9, 2018, at 10:55 PM, Sannyasin Brahmanathaswami via use-livecode
> <[email protected]> wrote:
>
> https://medium.com/exploring-code/why-should-you-learn-go-f607681fad65
>
> BR
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode