https://github.com/milindmadhukar/go-piston
A Wrapper of the Piston API in Golang
https://github.com/milindmadhukar/go-piston
golang piston piston-api wrapper
Last synced: 4 months ago
JSON representation
A Wrapper of the Piston API in Golang
- Host: GitHub
- URL: https://github.com/milindmadhukar/go-piston
- Owner: milindmadhukar
- License: mit
- Created: 2021-10-01T10:06:47.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-12-17T08:30:53.000Z (6 months ago)
- Last Synced: 2025-12-20T20:14:58.539Z (5 months ago)
- Topics: golang, piston, piston-api, wrapper
- Language: Go
- Homepage: https://pkg.go.dev/github.com/milindmadhukar/go-piston
- Size: 41 KB
- Stars: 13
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go-Piston!
This is a Go wrapper for working with the [Piston](https://github.com/engineer-man/piston) API.
It supports both the endpoints, namely `runtimes` and `execute`, mentioned [here](https://github.com/engineer-man/piston#public-api).
## 💻 Installation
To install the library simply open a terminal and type:
```
go get github.com/milindmadhukar/go-piston
```
## ️️🛠️ Tools Used
This project was written purely in `Golang` for `Golang`.
The module helps with the usage of the [Piston API](https://github.com/engineer-man/piston#public-api).
## 🏁 Basic Setup:
```go
package main
import (
"fmt"
"log"
piston "github.com/milindmadhukar/go-piston"
)
func main() {
client := piston.CreateDefaultClient()
execution, err := client.Execute("python", "", // Passing language. Since no version is specified, it uses the latest supported version.
[]piston.Code{
{Content: "inp = input()\nprint(inp[::-1])"},
}, // Passing Code.
piston.Stdin("hello world"), // Passing input as "hello world".
)
if err != nil {
log.Fatal(err)
}
fmt.Println(execution.GetOutput())
}
```
### Output
```
dlrow olleh
```
## 🧿 Extras
If you face any difficulties email me at hey(at)milind(dot)lol
Thats it, have fun ✚✖