@kjk1/

gobook cmdline args raw

Go

No description

fork
loading
Files
  • main.go

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.03809192985639642","path":"main.go","file":{"path":"main.go","content":{"asEncoding":{"base64":"Ly8gOnJ1biBnbyBydW4gJGZpbGUgLWVjaG8gZWNoby1hcmcgYWRkaXRpb25hbCBhcmcKLy8gbm8gcGxheWdyb3VuZApwYWNrYWdlIG1haW4KCmltcG9ydCAoCgkiZm10IgoJIm9zIgopCgovLyA6c2hvdyBzdGFydApmdW5jIG1haW4oKSB7CglmbXQuUHJpbnRmKCJOYW1lIG9mIGV4ZWN1dGFibGU6ICclcydcbiIsIG9zLkFyZ3NbMF0pCglhcmdzIDo9IG9zLkFyZ3NbMTpdCglmb3IgaSwgYXJnIDo9IHJhbmdlIGFyZ3MgewoJCWZtdC5QcmludGYoIkFyZyAlZCwgdmFsdWU6ICclcydcbiIsIGksIGFyZykKCX0KfQoKLy8gOnNob3cgZW5k"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// :run go run $file -echo echo-arg additional arg
// no playground
package main

import (
	"fmt"
	"os"
)

// :show start
func main() {
	fmt.Printf("Name of executable: '%s'\n", os.Args[0])
	args := os.Args[1:]
	for i, arg := range args {
		fmt.Printf("Arg %d, value: '%s'\n", i, arg)
	}
}

// :show end