diff --git a/README.md b/README.md index 807fe0a..8630d9b 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,11 @@ import ( ) func main() { - d := elton.New() + e := elton.New() target, _ := url.Parse("https://www.baidu.com") - d.GET("/*url", proxy.New(proxy.Config{ + e.GET("/*url", proxy.New(proxy.Config{ // proxy done will call this function Done: func(c *elton.Context) { @@ -34,6 +34,9 @@ func main() { Host: "www.baidu.com", })) - d.ListenAndServe(":3000") + err := e.ListenAndServe(":3000") + if err != nil { + panic(err) + } } ``` \ No newline at end of file diff --git a/example/main.go b/example/main.go index 7445ed3..045ddb6 100644 --- a/example/main.go +++ b/example/main.go @@ -9,11 +9,11 @@ import ( ) func main() { - d := elton.New() + e := elton.New() target, _ := url.Parse("https://www.baidu.com") - d.GET("/*url", proxy.New(proxy.Config{ + e.GET("/*url", proxy.New(proxy.Config{ // proxy done will call this function Done: func(c *elton.Context) { @@ -27,7 +27,7 @@ func main() { Host: "www.baidu.com", })) - err := d.ListenAndServe(":3000") + err := e.ListenAndServe(":3000") if err != nil { panic(err) } diff --git a/go.mod b/go.mod index ca45cd5..211d25f 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.12 require ( github.com/stretchr/testify v1.4.0 - github.com/vicanso/elton v0.2.2 + github.com/vicanso/elton v0.2.3 github.com/vicanso/hes v0.2.1 gopkg.in/h2non/gock.v1 v1.0.15 ) diff --git a/go.sum b/go.sum index ddf6061..558b02e 100644 --- a/go.sum +++ b/go.sum @@ -7,13 +7,12 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/vicanso/elton v0.2.2 h1:MZ5nfJFKBWDWnFPO8wRyPat8kZz3KoNBY0scemo7RFQ= -github.com/vicanso/elton v0.2.2/go.mod h1:QFZ+Un4LLBANtl0mExkqLD4uqw3JLA2ZCWUHaCsHOUg= +github.com/vicanso/elton v0.2.3 h1:XQskGFtw/hhtNXRU7dLX0OFcpG64pK4PMXh9CVjHVbA= +github.com/vicanso/elton v0.2.3/go.mod h1:QFZ+Un4LLBANtl0mExkqLD4uqw3JLA2ZCWUHaCsHOUg= github.com/vicanso/hes v0.2.1 h1:jRFEADmiQ30koVY/sKwlkhyXM5B3QbVVizLqrjNJgPw= github.com/vicanso/hes v0.2.1/go.mod h1:QcxOFmFfBQMhASTaLgnFayXYCgevdSeBVprt+o+3eKo= github.com/vicanso/intranet-ip v0.0.1 h1:cYS+mExFsKqewWSuHtFwAqw/CO66GsheB/P1BPmSTx0=