The Wayback Machine - https://web.archive.org/web/20230223144039/https://github.com/xta/okrun
Skip to content

xta/okrun

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

OK Run (golang)

ok, run your gofile. run your gofile when go run would not.

GoDoc

Features

okrun will automatically fix the following error(s):

  • imported and not used - when your gofile contains an imported package that is not used, okrun will comment out the offending import line.

Setup

// get okrun
go get github.com/xta/okrun

// install okrun
cd $GOPATH && go install github.com/xta/okrun/

Usage

okrun path/to/your/file.go

By using okrun, your file.go will attempt to run when go run would otherwise refuse.

Example

With file example.go:

package main

import (
  "fmt"
  "log"
)

func main() {
  fmt.Println("hi")
}

go run will not run example.go:

go run example.go
# command-line-arguments
example.go:5: imported and not used: "log"

okrun will run example.go:

okrun example.go
hi

okrun will update your gofile & properly format it. after running okrun, example.go is now:

package main

import (
  "fmt"
  //  "log"
)

func main() {
  fmt.Println("hi")
}

About

by Rex Feng 2014

License

MIT

About

ok, run your gofile

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages