Browse Source

use slice of pointers rather than pointer to slice

Will Norris 9 years ago
parent
commit
9fa26affe4
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      github/repos_traffic.go
  2. +2
    -2
      github/repos_traffic_test.go

+ 2
- 2
github/repos_traffic.go View File

@ -54,14 +54,14 @@ type TrafficData struct {
// TrafficViews represent information about the number of views in the last 14 days.
type TrafficViews struct {
Views *[]TrafficData `json:"views,omitempty"`
Views []*TrafficData `json:"views,omitempty"`
Count *int `json:"count,omitempty"`
Uniques *int `json:"uniques,omitempty"`
}
// TrafficClones represent information about the number of clones in the last 14 days.
type TrafficClones struct {
Clones *[]TrafficData `json:"clones,omitempty"`
Clones []*TrafficData `json:"clones,omitempty"`
Count *int `json:"count,omitempty"`
Uniques *int `json:"uniques,omitempty"`
}


+ 2
- 2
github/repos_traffic_test.go View File

@ -95,7 +95,7 @@ func TestRepositoriesService_ListTrafficViews(t *testing.T) {
}
want := &TrafficViews{
Views: &[]TrafficData{{
Views: []*TrafficData{{
Timestamp: &TimestampMS{time.Unix(1464710400, 0)},
Count: Int(7),
Uniques: Int(6),
@ -132,7 +132,7 @@ func TestRepositoriesService_ListTrafficClones(t *testing.T) {
}
want := &TrafficClones{
Clones: &[]TrafficData{{
Clones: []*TrafficData{{
Timestamp: &TimestampMS{time.Unix(1464710400, 0)},
Count: Int(7),
Uniques: Int(6),


Loading…
Cancel
Save