Sfoglia il codice sorgente

support running go files in subdirectories.

Lucas Stadler 11 anni fa
parent
commit
036be51f93
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      go/qst.go

+ 2 - 1
go/qst.go

@ -28,7 +28,8 @@ qst hello.go - compiles & runs hello.go
28 28
29 29
var mappings = map[string]func(string) string{
30 30
	".go": func(name string) string {
31
		return fmt.Sprintf("go build %s && ./%s", name, strings.TrimSuffix(name, path.Ext(name)))
31
		outpath := strings.TrimSuffix(name, path.Ext(name))
32
		return fmt.Sprintf("go build -o %s %s && ./%s", outpath, name, outpath)
32 33
	},
33 34
	".rb": func(name string) string {
34 35
		return fmt.Sprintf("ruby %s", name)