gorunfunc

(★ 11)

Cherry-pick go functions to run from cmd

File Explorer

  • .gitignore
  • example.gif
  • main.go
  • README.md

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

go get

View Details ▼

Add a dependency package, or download packages in legacy GOPATH mode.
Note: `./...` is a Go package pattern understood by Go tooling. It matches the current package and all packages recursively under the current directory.

go get {{example.com/pkg}}

Add a specified package to `go.mod` in module-mode or install the package in GOPATH-mode:

go get {{example.com/pkg}}@{{v1.2.3}}

Modify the package with a given version in module-aware mode:

go get {{example.com/pkg}}@{{none}}

Remove a specified package:

🔍

goimports

View Details ▼

Update Go import lines, adding missing ones and removing unreferenced ones.

goimports {{path/to/file.go}}

Display the completed import source file:

goimports -w {{path/to/file.go}}

Write the result back to the source file instead of `stdout`:

goimports -w -d {{path/to/file.go}}

Display diffs and write the result back to the source file:

// repository documentation