This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I have a JS background so I'm used to functions needing to be explicitly called. For example:
function newFunction() {} Call function newFunction()
http.ListenAndServe() is being called in my func main() but the syntax looks off...
func main() {
log.Print("Starting server on :4000")
err := http.ListenAndServe(":4000", mux)
log.Fatal(err)
}
To me, it looks like the variable err
is being assigned http.ListenAndServe(":4000", mux)
but how is it being called? Is it because err
is being called inside log.Fatal(err)
?
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/golang/comm...