* fix: constant definition loop on out of order vars * fix: do not wire global varDecl * fix: wire and execute global vars * chore: add tests * fix: refactor and lint
24 lines
246 B
Go
24 lines
246 B
Go
package main
|
|
|
|
var (
|
|
a = concat("hello", b)
|
|
b = concat(" ", c, "!")
|
|
c = d
|
|
d = "world"
|
|
)
|
|
|
|
func concat(a ...string) string {
|
|
var s string
|
|
for _, ss := range a {
|
|
s += ss
|
|
}
|
|
return s
|
|
}
|
|
|
|
func main() {
|
|
println(a)
|
|
}
|
|
|
|
// Output:
|
|
// hello world!
|