You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
656 B

  1. // Copyright 2017 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package gensupport
  5. import (
  6. "fmt"
  7. "runtime"
  8. "strings"
  9. )
  10. // GoogleClientHeader returns the value to use for the x-goog-api-client
  11. // header, which is used internally by Google.
  12. func GoogleClientHeader(generatorVersion, clientElement string) string {
  13. elts := []string{"gl-go/" + strings.Replace(runtime.Version(), " ", "_", -1)}
  14. if clientElement != "" {
  15. elts = append(elts, clientElement)
  16. }
  17. elts = append(elts, fmt.Sprintf("gdcl/%s", generatorVersion))
  18. return strings.Join(elts, " ")
  19. }