Skip to content

Commit

Permalink
go fmt and fixed some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrunwald committed May 28, 2016
1 parent 8df1834 commit 3890f7b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion trending.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (t *Trending) GetProjects(time, language string) ([]Project, error) {
contributorPath, exists := s.Find(".repo-list-meta a").First().Attr("href")
contributorURL := t.appendBaseHostToPath(contributorPath, exists)

// Collect contributer
// Collect contributor
var developer []Developer
s.Find(".repo-list-meta a img").Each(func(j int, devSelection *goquery.Selection) {
devName, exists := devSelection.Attr("title")
Expand Down
48 changes: 24 additions & 24 deletions trending_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ func TestGetDevelopers_Today(t *testing.T) {
backScreenURL, _ := url.Parse(server.URL + "/black-screen")
backScreenAvatar, _ := url.Parse("https://avatars0.githubusercontent.com/u/14174343?v=3")
want := []Developer{
Developer{
{
ID: 13479175,
DisplayName: "gloomyson",
FullName: "Ryuta",
URL: gloomysonURL,
Avatar: gloomysonAvatar,
},
Developer{
{
ID: 14174343,
DisplayName: "black-screen",
FullName: "Black Screen",
Expand Down Expand Up @@ -170,11 +170,11 @@ func TestGetTrendingLanguages(t *testing.T) {
uGo, _ := url.Parse("https://github.com/trending?l=go")
uJava, _ := url.Parse("https://github.com/trending?l=java")
want := []Language{
Language{"All languages", "", uAll},
Language{"Unknown languages", "unknown", uUnknown},
Language{"CSS", "css", uCSS},
Language{"Go", "go", uGo},
Language{"Java", "java", uJava},
{"All languages", "", uAll},
{"Unknown languages", "unknown", uUnknown},
{"CSS", "css", uCSS},
{"Go", "go", uGo},
{"Java", "java", uJava},
}

if !reflect.DeepEqual(languages, want) {
Expand Down Expand Up @@ -226,14 +226,14 @@ func TestGetLanguages(t *testing.T) {
uANTLR, _ := url.Parse("https://github.com/trending?l=antlr")

want := []Language{
Language{"ABAP", "abap", uAbap},
Language{"ActionScript", "as3", uActionScript},
Language{"Ada", "ada", uAda},
Language{"Agda", "agda", uAgda},
Language{"AGS Script", "ags-script", uAGS},
Language{"Alloy", "alloy", uAlloy},
Language{"AMPL", "ampl", uAMPL},
Language{"ANTLR", "antlr", uANTLR},
{"ABAP", "abap", uAbap},
{"ActionScript", "as3", uActionScript},
{"Ada", "ada", uAda},
{"Agda", "agda", uAgda},
{"AGS Script", "ags-script", uAGS},
{"Alloy", "alloy", uAlloy},
{"AMPL", "ampl", uAMPL},
{"ANTLR", "antlr", uANTLR},
}

if !reflect.DeepEqual(languages, want) {
Expand Down Expand Up @@ -322,7 +322,7 @@ func TestGetProjects(t *testing.T) {
bnoordhuisAvatar, _ := url.Parse("https://avatars1.githubusercontent.com/u/275871?v=3")

want := []Project{
Project{
{
Name: "gloomyson/StarCraft",
Owner: "gloomyson",
RepositoryName: "StarCraft",
Expand All @@ -332,7 +332,7 @@ func TestGetProjects(t *testing.T) {
URL: uStarcraft,
ContributerURL: uStarcraftcontributor,
Contributer: []Developer{
Developer{
{
ID: 13479175,
DisplayName: "gloomyson",
FullName: "",
Expand All @@ -341,7 +341,7 @@ func TestGetProjects(t *testing.T) {
},
},
},
Project{
{
Name: "black-screen/black-screen",
Owner: "black-screen",
RepositoryName: "black-screen",
Expand All @@ -351,21 +351,21 @@ func TestGetProjects(t *testing.T) {
URL: uBlackScreen,
ContributerURL: uBlackScreencontributor,
Contributer: []Developer{
Developer{
{
ID: 188928,
DisplayName: "shockone",
FullName: "",
URL: shockoneURL,
Avatar: shockoneAvatar,
},
Developer{
{
ID: 6943514,
DisplayName: "G07cha",
FullName: "",
URL: g07chaURL,
Avatar: g07chaAvatar,
},
Developer{
{
ID: 1307169,
DisplayName: "RobertoUa",
FullName: "",
Expand All @@ -374,7 +374,7 @@ func TestGetProjects(t *testing.T) {
},
},
},
Project{
{
Name: "nodejs/node",
Owner: "nodejs",
RepositoryName: "node",
Expand All @@ -384,14 +384,14 @@ func TestGetProjects(t *testing.T) {
URL: uNode,
ContributerURL: uNodecontributor,
Contributer: []Developer{
Developer{
{
ID: 80,
DisplayName: "ry",
FullName: "",
URL: ryURL,
Avatar: ryAvatar,
},
Developer{
{
ID: 275871,
DisplayName: "bnoordhuis",
FullName: "",
Expand Down
6 changes: 3 additions & 3 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (

// Trending reflects the main datastructure of this package.
// It doesn`t provide an exported state, but based on this the methods are called.
// To recieve a new instance just add
// To receive a new instance just add
//
// package main
//
Expand Down Expand Up @@ -78,11 +78,11 @@ type Project struct {
// URL is the http(s) address of the project reflected as url.URL datastructure like "https://github.com/Workiva/go-datastructures".
URL *url.URL

// ContributerURL is the http(s) address of the contributers page of the project reflected as url.URL datastructure like "https://github.com/Workiva/go-datastructures/graphs/contributors".
// ContributerURL is the http(s) address of the contributors page of the project reflected as url.URL datastructure like "https://github.com/Workiva/go-datastructures/graphs/contributors".
ContributerURL *url.URL

// Contributer are a collection of Developer.
// Be aware that this collection don`t covers all contributer.
// Be aware that this collection don`t covers all contributor.
// Only those who are mentioned at githubs trending page.
Contributer []Developer
}
Expand Down

0 comments on commit 3890f7b

Please sign in to comment.