En | 中文
newgo is a GOPATH solution tool. Officially to build and run go packages, your must have global or temporary GOPATH and GOBIN enviroment variables, it's a annoying and not enough freedom. Now newgo solved it, so you can easily use golang in your different projects with newgo. And in different projects, it will automatically create temporary GOPATH and GOBIN to system shell enviroment variable.
It's easy to be installed.
You can use homebrew to install it.
brew tap newtorn/tap && brew install newgo
You should download or copy newgo shell script.
# First by method 1
# copy newgo shell script to newgo file
# First by method 2
# or git clone newgo repo
git clone https://github.com/newtorn/newgo.git
cd newgo
# Second
mv newgo /usr/local/bin/newgo
# Test
newgo help
# first go to your projects
mkdir go-demo
cd go-demo
# initialize newgo
# it will create three floders src, pkg and bin
newgo init
# edit program
mkdir src/hello-app
cd src/hello-app
vim hello.go
# then you can use newgo instead of default go
# exmaple for command go run
newgo run hello.go
# exmaple for command go build
newgo build hello.go
# exmaple for command go install
newgo install hello.go
# Get help
newgo help
Once you leave current project and initialize newgo in another project, when you enter this project you must reinitialize again to use newgo.
I'd love you to contribute to newgo, please read my Contribution Guide
Code license with MIT