Last active
December 25, 2015 09:18
-
-
Save jazzdan/6952577 to your computer and use it in GitHub Desktop.
What is syntactically wrong between lines 11 and 14?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14: syntax error: unexpected semicolon or newline, expecting ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"log" | |
"github.com/elazarl/goproxy" | |
) | |
func main() { | |
proxy := goproxy.NewProxyHttpServer() | |
proxy.OnRequest().DoFunc( | |
func(r *http.Request, ctx *goproxy.ProxyCtx)(*http.Request, *http.Response) { | |
return r, "derp" | |
} | |
) | |
proxy.Verbose = true | |
log.Fatal(http.ListenAndServe(":8080", proxy)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it's trying to insert a semicolon on line 14.
normally you would just name the function, like this:
but to be totally candid, I'm not familiar with this library but the fact that it uses a function instead of an interface is highly suspect.