calling_const_func.go 198 B

12345678910111213
  1. package main
  2. import "fmt"
  3. // Won't work. Funcs are not constant, but why?
  4. const MyConstFunc = func() string {
  5. return "This is from your ConstFunc!"
  6. }
  7. func main() {
  8. fmt.Println(MyConstFunc())
  9. }