gorun

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

README

gorun

Run Go snippets without installing the Go toolchain.

Example

#! /usr/bin/env gorun

package main

import "fmt"

func main() {
   fmt.Println("standalone go code - no toolchain to install")
}

Install

Download ready executables for linux or mac under Releases

Install from source

go install github.com/bir3/gorun/cmd/gorun@latest

The executable is normally found in $HOME/go/bin - else see go install documentation

Features

  • Runs without installing the Go toolchain as it's already embedded in the executable.
  • Resulting executables are cached for fast startup.
  • Size of gorun is 47 MB and just one file

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileString added in v0.5.0

func CompileString(c *cache.Config, goCode string, args []string, input string) (string, error)

func Exec added in v0.5.0

func Exec(exefile string, args []string) error

func GorunVersion added in v0.5.0

func GorunVersion() string

Types

type CompileError

type CompileError struct {
	Stdout string
	Stderr string
	Err    error
}

func (*CompileError) Error

func (c *CompileError) Error() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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