TLDR:
go is not the event handler of the first button. The event handler is an anonymous function generated by the HTML parser. In the example, the generated handler just happens to call go.
JavaScript code provided in HTML for an onEventName attribute is compiled into a function of form
function(event) {
    // code written in the attribute value
}
Functions generated by the parser in this way have a rather strange scope chain which includes the element the generated handler is a property of, any outer form element the element is within, and the document object, at least. Reasons for the scope chain date back to before the DOM was standardized. Older IE releases provided window.event instead of the event parameter.
So the first button
 <button onclick="go()">clic1</button>
in current browsers generates the button's onclick handler as:
 function( event) {
     go()
 }
- the onclick handler is the function taking the - eventparameter. It is called with a- thisvalue of the button.
 
- gois an ordinary function call - the- thisvalue of the caller has not been applied. You could, say, pass on- thisas a parameter by calling- go(this)if you wanted to.
 
- gowas declared using the- functionkeyword and by default has a- thisvalue of the global object.
 
- If you must attach a [- myHandler] function in HTML to be called like an event handler, add an attribute in the opening tag like
 - oneventname = "myHandler.call(this, event)"
 - or provided the - thisvalue is not required, simply
 - oneventname="myHandler(event);
 
In the second example, you compile an anonymous function expression normally (not using the HTML parser) and attach it directly to the second button element.`