aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/repos_traffic.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-github/github/repos_traffic.go')
-rw-r--r--vendor/github.com/google/go-github/github/repos_traffic.go20
1 files changed, 4 insertions, 16 deletions
diff --git a/vendor/github.com/google/go-github/github/repos_traffic.go b/vendor/github.com/google/go-github/github/repos_traffic.go
index 9688b58..0713c73 100644
--- a/vendor/github.com/google/go-github/github/repos_traffic.go
+++ b/vendor/github.com/google/go-github/github/repos_traffic.go
@@ -60,16 +60,13 @@ func (s *RepositoriesService) ListTrafficReferrers(owner, repo string) ([]*Traff
return nil, nil, err
}
- // TODO: remove custom Accept header when this API fully launches.
- req.Header.Set("Accept", mediaTypeTrafficPreview)
-
- trafficReferrers := new([]*TrafficReferrer)
+ var trafficReferrers []*TrafficReferrer
resp, err := s.client.Do(req, &trafficReferrers)
if err != nil {
return nil, resp, err
}
- return *trafficReferrers, resp, err
+ return trafficReferrers, resp, nil
}
// ListTrafficPaths list the top 10 popular content over the last 14 days.
@@ -83,16 +80,13 @@ func (s *RepositoriesService) ListTrafficPaths(owner, repo string) ([]*TrafficPa
return nil, nil, err
}
- // TODO: remove custom Accept header when this API fully launches.
- req.Header.Set("Accept", mediaTypeTrafficPreview)
-
- var paths = new([]*TrafficPath)
+ var paths []*TrafficPath
resp, err := s.client.Do(req, &paths)
if err != nil {
return nil, resp, err
}
- return *paths, resp, err
+ return paths, resp, nil
}
// ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week.
@@ -110,9 +104,6 @@ func (s *RepositoriesService) ListTrafficViews(owner, repo string, opt *TrafficB
return nil, nil, err
}
- // TODO: remove custom Accept header when this API fully launches.
- req.Header.Set("Accept", mediaTypeTrafficPreview)
-
trafficViews := new(TrafficViews)
resp, err := s.client.Do(req, &trafficViews)
if err != nil {
@@ -137,9 +128,6 @@ func (s *RepositoriesService) ListTrafficClones(owner, repo string, opt *Traffic
return nil, nil, err
}
- // TODO: remove custom Accept header when this API fully launches.
- req.Header.Set("Accept", mediaTypeTrafficPreview)
-
trafficClones := new(TrafficClones)
resp, err := s.client.Do(req, &trafficClones)
if err != nil {