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
1.png gasp.png prometheus.png | |
1down.png gavel.gif promise.gif | |
1password.png gavel.png promptworks.png | |
1train.png gcp.png protoss.png | |
1up.png gentleman_parrot.gif psy.gif | |
2.png gentlemanparrot.gif psych.gif | |
2train.png getwellsoon.png psyduck.png | |
3.png ghost.gif pubsub.png | |
4.png ghostbusters.png pudina.jpg | |
49ers.jpg ghostbusters_pepe.jpg pug.gif |
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
rm licenses.csv | |
touch licenses.csv | |
echo "name,url,version,license" >> licenses.csv | |
deps=$(go list -m -json all | jq -c .) | |
for dep in $deps; do | |
path=$(echo $dep | jq -r .Path) | |
if [[ "$path" == "github.com/syndio/syndio" ]]; then | |
continue | |
fi |
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 ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
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
func TestAuth(t *testing.T) { | |
assert := assert.New(t) | |
tests := []struct { | |
description string | |
url string | |
expectedBody string | |
expectedCode 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
// GetTestHandler returns a http.HandlerFunc for testing http middleware | |
func GetTestHandler() http.HandlerFunc { | |
fn := func(rw http.ResponseWriter, req *http.Request) { | |
panic("test entered test handler, this should not happen") | |
} | |
return http.HandlerFunc(fn) | |
} |
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 ( | |
"log" | |
"net/http" | |
"github.com/gorilla/context" | |
) | |
var ( |
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
var c = ReposClient{} | |
func TestGet(t *testing.T) { | |
assert := assert.New(t) | |
httpmock.Activate() | |
defer httpmock.DeactivateAndReset() | |
tests := []struct { | |
description string |
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
func TestGetReposHandler(t *testing.T) { | |
assert := assert.New(t) | |
tests := []struct { | |
description string | |
reposClient *ReposTestClient | |
url string | |
expectedStatusCode int | |
expectedBody string | |
}{ |
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
type ReposTestClient struct { | |
Repos []repos.Repo | |
Err error | |
} | |
func (c ReposTestClient) Get(string) ([]repos.Repo, error) { | |
return c.Repos, c.Err | |
} |
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
type Client interface { | |
Get(string) ([]Repo, error) | |
} | |
type ReposClient struct{} | |
func (c ReposClient) Get(user string) ([]Repo, error) { | |
// call github api | |
} |
NewerOlder