Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
username="$1"
repo="$2"
[ $# -ne 2 ] && { echo "Usage: $0 [your github username] [repo name without github.com/]"; exit 1; }
org=`dirname $repo`
name=`basename $repo`
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"log"
)
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"log"
)
@shawnps
shawnps / gist:8206849
Last active January 1, 2016 21:59
Golang test coverage improvements by shawnps
time: 89.6% => 90.4% (tests for Duration.Nanoseconds, Duration.Minutes, Duration.Hours, Tick, NewTicker)
encoding/json: 87.2% => 88.5% (test for HTMLEscape)
strconv: 95.6% => 96.5% (add tests for FormatBool and AppendBool, remove unused atof32int function)
bytes: 91.6% => 92.2% (improve Title test coverage by adding cases with underscore and unicode line separator, add test for bytes.Contains)
ascii85: 92.4% => 93.1% (add empty string case for Encode test)
asn1: 79.5% => 80.6% (test for ObjectIdentifier.Equal)
html: 82.1% => 93.4% (test edge cases for UnescapeString function, where string is only a single ‘&’ or string starts with ‘&’ but is not an entity, like ‘&test’)
encoding/csv: 90.3% => 91.5% (remove unexported, unused function ‘unreadRune’)
strings: 96.4% => 96.7% (add same Title tests as bytes)
crypto/cipher: 84.6% => 86.4% (remove unused shiftl function)