// Execute under GOPATH, go mod name defaults to the current path relative to GOPATH, or you can specify your own
hz new
// Execute under non-GOPATH, you need to specify the go mod name
hz new -mod hertz/demo
// Tidy & get dependencies
go mod tidy
After executed, it generates a scaffold for the Hertz project in the current directory.
go build
Run the project:
./{{your binary}}
Test:
curl 127.0.0.1:8888/ping
If it returns {"message":"pong"}
, it works.