Move deps from _workspace/ to vendor/
godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
This commit is contained in:
22
vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go
generated
vendored
Normal file
22
vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/emicklei/go-restful"
|
||||
"io"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// This example shows the minimal code needed to get a restful.WebService working.
|
||||
//
|
||||
// GET http://localhost:8080/hello
|
||||
|
||||
func main() {
|
||||
ws := new(restful.WebService)
|
||||
ws.Route(ws.GET("/hello").To(hello))
|
||||
restful.Add(ws)
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
func hello(req *restful.Request, resp *restful.Response) {
|
||||
io.WriteString(resp, "world")
|
||||
}
|
||||
Reference in New Issue
Block a user