This file contains 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
function eachWithIdx(iterable, f) { var i = iterable.iterator(); var idx = 0; while (i.hasNext()) f(i.next(), idx++); } | |
function mapEach(iterable, f) { var vs = []; eachWithIdx(iterable, function (i) { vs.push(f(i));}); return vs; } | |
function escape(str) { | |
str = str.replaceAll("\t|\b|\\f", ""); | |
str = com.intellij.openapi.util.text.StringUtil.escapeXml(str); | |
return str; | |
} | |
var NEWLINE = "\n"; | |
var EMPTY = "_EMPTY_"; |
This file contains 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
// ==UserScript== | |
// @name Golang Release Notes CL Links | |
// @namespace https://github.com/nussjustin | |
// @version 0.1 | |
// @description Displays links to CLs on Go release notes | |
// @author Justin Nuß | |
// @match https://golang.org/doc/go*.* | |
// @match https://tip.golang.org/doc/go*.* | |
// @grant none | |
// ==/UserScript== |
This file contains 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 ( | |
"bufio" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"strconv" |
This file contains 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
// Copyright 2009 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
package xml | |
import ( | |
"bytes" | |
"encoding" | |
"errors" |
This file contains 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 iface_test | |
import "testing" | |
func setOneLine(p *int, v interface{}) { | |
*p = v.(int) | |
} | |
func setTwoLines(p *int, v interface{}) { | |
intv := v.(int) |
This file contains 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
PASS | |
BenchmarkClientStreamc1-8 30000 121497 ns/op 2015 B/op 46 allocs/op | |
--- Histogram (unit: µs) | |
Count: 30000 Min: 54 Max: 1147 Avg: 118.84 | |
------------------------------------------------------------ | |
[ 54, 55) 1 0.0% 0.0% | |
[ 55, 56) 2 0.0% 0.0% | |
[ 56, 57) 3 0.0% 0.0% | |
[ 57, 58) 6 0.0% 0.0% | |
[ 58, 60) 31 0.1% 0.1% |