@kjk1/

gobook goto

Go

No description

fork
loading
Files
  • main.go

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.8615533437150735","path":"main.go","file":{"path":"main.go","content":{"asEncoding":{"base64":"cGFja2FnZSBtYWluCgppbXBvcnQgImZtdCIKCi8vIDpzaG93IHN0YXJ0CmZ1bmMgcHJpbnRJc09kZChuIGludCkgewoJaWYgbiUyID09IDEgewoJCWdvdG8gaXNPZGQKCX0KCWZtdC5QcmludGYoIiVkIGlzIGV2ZW5cbiIsIG4pCglyZXR1cm4KCmlzT2RkOgoJZm10LlByaW50ZigiJWQgaXMgb2RkXG4iLCBuKQp9CgovLyA6c2hvdyBlbmQKCmZ1bmMgbWFpbigpIHsKCS8vIDpzaG93IHN0YXJ0CglwcmludElzT2RkKDUpCglwcmludElzT2RkKDE4KQoJLy8gOnNob3cgZW5kCn0="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import "fmt"

// :show start
func printIsOdd(n int) {
	if n%2 == 1 {
		goto isOdd
	}
	fmt.Printf("%d is even\n", n)
	return

isOdd:
	fmt.Printf("%d is odd\n", n)
}

// :show end

func main() {
	// :show start
	printIsOdd(5)
	printIsOdd(18)
	// :show end
}