Minified Version
javascript:(function(t,o){if("github.com"===o.hostname){var n=o.pathname,i=n.split("/")[1],a=n.split("/")[2],c=function(){return/^\/[^\/]+\/[^\/]+/.test(o.pathname)};c()&&t.open("https://godoc.org/github.com/"+i+"/"+a)}})(window,location);
Full Version
javascript:(function(w, l){
// functions & variables
// powered by sindresorhus@refined-github
if (l.hostname !== 'github.com') { return; }
var path = l.pathname;
var ownerName = path.split('/')[1];
var repoName = path.split('/')[2];
var isRepo = function () { return /^\/[^/]+\/[^/]+/.test(l.pathname); };
if (isRepo()) {
w.open('https://godoc.org/github.com/' + ownerName + '/' + repoName);
}
})(window, location);