title: Function declaration syntax: things in parenthesis before function name
body: <p>I'm sorry I couldn't be more specific in the question title, but I was reading some <a href="https://golang.org/" rel="noreferrer">Go</a> code and I encountered function declarations of this form:</p>
  <pre><code>func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
      ...
  }
  </code></pre>
  <p>from <a href="https://github.com/mattermost/platform/blob/master/api/context.go" rel="noreferrer">https://github.com/mattermost/platform/blob/master/api/context.go</a></p>
  <pre><code>func (s *GracefulServer) BlockingClose() bool {
      ...
  }
  </code></pre>
  <p>from <a href="https://github.com/braintree/manners/blob/master/server.go" rel="noreferrer">https://github.com/braintree/manners/blob/master/server.go</a></p>
  <p>What does the <code>(h handler)</code> and the <code>(s *GracefulServer)</code> between parenthesis mean? What does the entire function declaration mean, taking into account the meaning of the things between parenthesis?</p>
  <h3>Edit</h3>
  <p>This is not a duplicate of <a href="https://stackoverflow.com/questions/8263546/whats-the-difference-of-functions-and-methods-in-google-go">Whats the difference of functions and methods in Go?</a> : this question came to me because I didn't know what the things in parenthesis before the function name were, not because I wondered what was the difference between functions and methods... if I knew that this declaration was a method I wouldn't have had this question in the first place. If someone has the same doubt as me one day, I don't believe she will go searching for &quot;golang methods&quot; because she doesn't know that this is the case. It would be like wondering what the letter &quot;sigma&quot; means before a mathematical expression (not knowing it means summation) and someone says it's a duplicate of what's the difference between summation and some other thing.</p>
  <p>Also, the short answer to this question (&quot;it's a receiver&quot;) is no answer to &quot;what's the difference between functions and methods&quot;.</p>