Init a new Go project or Open a pdf file or a path in Linux and Windows with the same command
Install
# GitHub Install
go get -ldflags=-s -u -v github.com/wasmup/g
g --version
which g
file $(which g)
g -help
Create a new Go module or add Makefile, main.go, main_test.go or README.md
mkdir hello
cd hello
g -init
code .
Creates a new main.go
, main_test.go
, Makefile
, README.md
files if not exist, and runs
go mod init $(FolderName)
.
Output:
Create a Web project
mkdir hello
cd hello
g -web
code .
Open a pdf file at a specific page
g 12 filename.pdf
Open the current dir using explorer/nautilus
g
Open Go src path
e.g. ($GOPATH/src/github.com/wasmup/g
):
g -go github.com/wasmup/g
Show environment variables value per line
g -echo GOPATH GOBIN GOROOT
g -echo G_ROOT G_RDR HOME
Set G_ROOT
environment variable to replace /
at the begining of the path.
Set G_RDR
environment variable for pdf document reader.
Set HOME
environment variable to replace ~
.