This is a creation in
Article, where the information may have evolved or changed.
Http://github.com/hoisie/web
git clone http://github.com/hoisie/web
Then perform a compilation installation
CD Web && Go Build
Server.go:7:2:cannot Find Package "Golang.org/x/net/websocket" in any of:
/usr/local/go/src/golang.org/x/net/websocket (from $GOROOT)
($GOPATH not set)
bash-3.2# Echo $GOPATH
bash-3.2# Go get Golang.org/x/net/websocket
If you do not encounter a similar error message, you can skip
(
Cannot find package "Golang.org/x/net/websocket" in any of:
)
bash-3.2# Go Build
bash-3.2# ls
According to the current understanding, it should be Gopath is to store non-core go lib, and Goroot is about go and runtime directory
= = = First run a demo look
Package Main
Import (
"Github.com/hoisie/web"
)
Func Hello (val String) string {return "Hello" + val}
Func Main () {
Web. Get ("/(. *)", hello)
Web. Run ("0.0.0.0:9999")
}
I feel like this. Two presentations in the development architecture, operation and maintenance architecture, technical framework, Team competency model, business transformation and other aspects of a very good overall re-planning and definition, customer-oriented, end-to-end micro-digital management, iterative evolution and other concepts are very advanced and correct.
Go Run hello.go
"
Hello.go:4:5:cannot Find Package "Github.com/hoisie/web" in any of:
/usr/local/go/src/github.com/hoisie/web (from $GOROOT)
"
Go get Github.com/hoisie/web
Files will be added to the Gopath directory
Get the library from Go get Lib
Func Main () {
Web. Get ("/(. *)", hello)
Web. Run ("0.0.0.0:9999")
}
Http://localhost:9999/third
This third will be used as the parameter Hello function, and the web. Get ("/(. *)", hello), which indicates that any format URL is handled by hello