This file contains hidden or 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
| # According to the go src (https://github.com/golang/go/blob/master/src/crypto/x509/sec1_test.go) | |
| # this is how to use openssl to generate an EC private key. Go can't read it | |
| # however. | |
| # openssl ecparam -name secp521r1 -genkey -param_enc explicit -outform PEM -out $@ | |
| # e.g: | |
| got asn1: structure error: tags don't match (6 vs {class:0 tag:16 length:450 isCompound:true}) {optional:false ex | |
| plicit:false application:false defaultValue:<nil> tag:<nil> stringType:0 set:false omitEmpty:false} ObjectIdentifier @4 | |
| # For debugging the private key |
This file contains hidden or 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 sets | |
| import "testing" | |
| func BenchmarkUnitSet(b *testing.B) { | |
| for i := 0; i < b.N; i++ { | |
| values := make(map[int]struct{}) | |
| for j := 0; j < 1000; j++ { | |
| values[j] = struct{}{} | |
| } |
This file contains hidden or 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 "fmt" | |
| func main() { | |
| collection := []int{1, 2, 3, 4, 5} | |
| ptr1 := &collection[0] | |
| ptr2 := &collection[1] | |
| ptr3 := &collection[2] |
This file contains hidden or 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 "fmt" | |
| type Trait interface { | |
| String() string | |
| } | |
| type Traitable struct { | |
| } |
This file contains hidden or 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 "fmt" | |
| type Level int | |
| const CODE Level = 1 | |
| type Logger struct { | |
| } |
This file contains hidden or 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 ( | |
| "fmt" | |
| "runtime" | |
| ) | |
| func main() { | |
| s := new(runtime.MemStats) | |
| runtime.ReadMemStats(s) |
This file contains hidden or 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
| #!/usr/bin/env bash -e | |
| organization=$1 | |
| if [ -z $organization ]; then | |
| echo "Usage: $0 <organization>" | |
| echo | |
| echo "Make sure to specify \$GITHUB_API_TOKEN as an environment variable." | |
| echo "Acquire one here: https://github.com/settings/tokens" | |
| echo |
This file contains hidden or 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
| #!/usr/bin/env bash -e | |
| organization=$1 | |
| if [ -z $organization ]; then | |
| echo "Usage: $0 <organization>" | |
| echo | |
| echo "Make sure to specify \$GITHUB_API_TOKEN as an environment variable." | |
| echo "Acquire one here: https://github.com/settings/tokens" | |
| echo |
This file contains hidden or 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
| 04b1284c8c594867a13a16fa513016a006f7a7b1c92727ca3060c33955644fbeb3b7db1bd5d67b6249cdf1fb43305eefd081c363b0664ebb95b8b40e37e2290b51 |
This file contains hidden or 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
| func TestHeightsController_Index(t *testing.T) { | |
| threshold := big.NewInt(2) | |
| tests := []struct { | |
| name string | |
| status int | |
| }{ | |
| {"good clients", 200}, | |
| // Hard to do error cases without adding an if with difference setup. could add test helpers... | |
| } |