all: remove egregious call to SetOpaque

This changes the generator google-api-go-generator/gen.go to not call
SetOpaque when there are no "path args" that need expanding via
uritemplates.

This call to SetOpaque was unecessary, the call to url.Parse (within
http.NewRequest on the line just before) will correctly set Path and
(optionally) RawPath to ensure that the URL is escaped correctly:
SetOpaque can only cause pain.

Issue #161

Change-Id: Id3376eca225dd623d9e1664bc35e5b7d364cbe46
Reviewed-on: https://code-review.googlesource.com/7111
Reviewed-by: Dave Day <djd@golang.org>
117 files changed
tree: 3f41f14a36bb0cdf8abe87cbf37c02ff33869748
  1. acceleratedmobilepageurl/
  2. adexchangebuyer/
  3. adexchangebuyer2/
  4. adexchangeseller/
  5. admin/
  6. adsense/
  7. adsensehost/
  8. analytics/
  9. analyticsreporting/
  10. androidenterprise/
  11. androidpublisher/
  12. appengine/
  13. appsactivity/
  14. appstate/
  15. autoscaler/
  16. bigquery/
  17. blogger/
  18. books/
  19. calendar/
  20. civicinfo/
  21. classroom/
  22. cloudbilling/
  23. cloudbuild/
  24. clouddebugger/
  25. clouderrorreporting/
  26. cloudlatencytest/
  27. cloudmonitoring/
  28. cloudresourcemanager/
  29. cloudtrace/
  30. clouduseraccounts/
  31. compute/
  32. consumersurveys/
  33. container/
  34. content/
  35. coordinate/
  36. customsearch/
  37. dataflow/
  38. dataproc/
  39. datastore/
  40. deploymentmanager/
  41. dfareporting/
  42. discovery/
  43. dns/
  44. doubleclickbidmanager/
  45. doubleclicksearch/
  46. drive/
  47. examples/
  48. firebaserules/
  49. fitness/
  50. freebase/
  51. fusiontables/
  52. games/
  53. gamesconfiguration/
  54. gamesmanagement/
  55. gan/
  56. genomics/
  57. gensupport/
  58. gmail/
  59. google-api-go-generator/
  60. googleapi/
  61. groupsmigration/
  62. groupssettings/
  63. iam/
  64. identitytoolkit/
  65. integration-tests/
  66. internal/
  67. iterator/
  68. kgsearch/
  69. language/
  70. lib/
  71. licensing/
  72. logging/
  73. manager/
  74. mapsengine/
  75. mirror/
  76. monitoring/
  77. oauth2/
  78. option/
  79. pagespeedonline/
  80. partners/
  81. people/
  82. playmoviespartner/
  83. plus/
  84. plusdomains/
  85. prediction/
  86. proximitybeacon/
  87. pubsub/
  88. qpxexpress/
  89. replicapool/
  90. replicapoolupdater/
  91. reseller/
  92. resourceviews/
  93. runtimeconfig/
  94. safebrowsing/
  95. script/
  96. servicecontrol/
  97. servicemanagement/
  98. serviceregistry/
  99. sheets/
  100. siteverification/
  101. spectrum/
  102. speech/
  103. sqladmin/
  104. storage/
  105. storagetransfer/
  106. tagmanager/
  107. taskqueue/
  108. tasks/
  109. toolresults/
  110. translate/
  111. transport/
  112. urlshortener/
  113. vision/
  114. webfonts/
  115. webmasters/
  116. youtube/
  117. youtubeanalytics/
  118. youtubereporting/
  119. .hgignore
  120. .hgtags
  121. .travis.yml
  122. api-list.json
  123. AUTHORS
  124. CONTRIBUTING.md
  125. CONTRIBUTORS
  126. GettingStarted.md
  127. key.json.enc
  128. LICENSE
  129. Makefile
  130. NOTES
  131. README.md
  132. TODO
README.md

Google APIs Client Library for Go

Status

Build Status

These are auto-generated Go libraries from the Google Discovery Service's JSON description files of the available “new style” Google APIs.

Due to the auto-generated nature of this collection of libraries, complete APIs or specific versions can appear or go away without notice. As a result, you should always locally vendor any API(s) that your code relies upon.

Announcement email:

Getting started documentation:

In summary:

$ go get google.golang.org/api/storage/v1
$ go get google.golang.org/api/tasks/v1
$ go get google.golang.org/api/moderator/v1
... etc ...

For docs, see e.g.:

The package of a given import is the second-to-last component, before the version number.

For examples, see:

For support, use the golang-nuts@ mailing list:

Application Default Credentials Example

Application Default Credentials provide a simplified way to obtain credentials for authenticating with Google APIs.

The Application Default Credentials authenticate as the application itself, which make them great for working with Google Cloud APIs like Storage or Datastore. They are the recommended form of authentication when building applications that run on Google Compute Engine or Google App Engine.

Default credentials are provided by the golang.org/x/oauth2/google package. To use them, add the following import:

import "golang.org/x/oauth2/google"

Some credentials types require you to specify scopes, and service entry points may not inject them. If you encounter this situation you may need to specify scopes as follows:

import (
        "golang.org/x/net/context"
        "golang.org/x/oauth2/google"
        "google.golang.org/api/compute/v1"
)

func main() {
        // Use oauth2.NoContext if there isn't a good context to pass in.
        ctx := context.Background()

        client, err := google.DefaultClient(ctx, compute.ComputeScope)
        if err != nil {
                //...
        }
        computeService, err := compute.New(client)
        if err != nil {
                //...
        }
}

If you need a oauth2.TokenSource, use the DefaultTokenSource function:

ts, err := google.DefaultTokenSource(ctx, scope1, scope2, ...)
if err != nil {
        //...
}
client := oauth2.NewClient(ctx, ts)

See also: golang.org/x/oauth2/google package documentation.