diff --git a/storage/internal/version.go b/storage/internal/version.go new file mode 100644 index 000000000000..0b0f0e914120 --- /dev/null +++ b/storage/internal/version.go @@ -0,0 +1,18 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal + +// Version is the current tagged release of the library. +const Version = "1.20.0" diff --git a/storage/storage.go b/storage/storage.go index 07a5ee077c33..457d77c8dbc9 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -40,6 +40,7 @@ import ( "cloud.google.com/go/internal/optional" "cloud.google.com/go/internal/trace" "cloud.google.com/go/internal/version" + "cloud.google.com/go/storage/internal" gapic "cloud.google.com/go/storage/internal/apiv2" "github.com/googleapis/gax-go/v2" "golang.org/x/oauth2/google" @@ -69,7 +70,7 @@ var ( errMethodNotValid = fmt.Errorf("storage: HTTP method should be one of %v", reflect.ValueOf(signedURLMethods).MapKeys()) ) -var userAgent = fmt.Sprintf("gcloud-golang-storage/%s", version.Repo) +var userAgent = fmt.Sprintf("gcloud-golang-storage/%s", internal.Version) const ( // ScopeFullControl grants permissions to manage your @@ -91,7 +92,7 @@ const ( defaultConnPoolSize = 4 ) -var xGoogHeader = fmt.Sprintf("gl-go/%s gccl/%s", version.Go(), version.Repo) +var xGoogHeader = fmt.Sprintf("gl-go/%s gccl/%s", version.Go(), internal.Version) func setClientHeader(headers http.Header) { headers.Set("x-goog-api-client", xGoogHeader)