Help us shape the future of Go! Take the 2026 Go Developer Survey

gocloud

command module
v0.0.0-...-24a6192 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

README

Sublime's custom image

GoCloud Build Status GoDoc GolangCI goreportcard codecov PRs Welcome GPLv3 license

Playground runner. Inspired by https://github.com/scukonick/gocloud.

Supports:
Usage:
As a program
$ cat program.go | ./gocloud

or

$ ./gocloud -f program.go 
As a lib:
package main

import (
	"fmt"
	"github.com/tdakkota/gocloud/lib"
	"net/http"
	"time"
)

const code = `
package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello, playground")
}
`

func main() {
	comp := lib.NewDefault(&http.Client{Timeout: 30 * time.Second})

	result, err := comp.Run(code)
	if err != nil {
		panic(err)
	}

	fmt.Print(result) // prints Hello, playground\n
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL