strings.mx raw
1 // transpiled from Go by mx-transpile - review TODOs before use
2
3 package example
4
5 import (
6 "fmt" // TODO: verify fmt compatibility with Moxie
7 "mx/bytes"
8 )
9
10 func greet(name []byte) []byte {
11 return "Hello, " | name | "!"
12 }
13
14 func contains(haystack, needle []byte) bool {
15 return bytes.Contains(haystack, needle)
16 }
17
18 func process(data []byte) []byte {
19 s := []byte(data)
20 fmt.Println(s)
21 return s
22 }
23
24 func join(parts [][]byte, sep []byte) []byte {
25 return bytes.Join(parts, sep)
26 }
27