Blame vendor/github.com/Azure/go-autorest/autorest/adal/version.go

Packit 63bb0d
package adal
Packit 63bb0d
Packit 63bb0d
import (
Packit 63bb0d
	"fmt"
Packit 63bb0d
	"runtime"
Packit 63bb0d
)
Packit 63bb0d
Packit 63bb0d
// Copyright 2017 Microsoft Corporation
Packit 63bb0d
//
Packit 63bb0d
//  Licensed under the Apache License, Version 2.0 (the "License");
Packit 63bb0d
//  you may not use this file except in compliance with the License.
Packit 63bb0d
//  You may obtain a copy of the License at
Packit 63bb0d
//
Packit 63bb0d
//      http://www.apache.org/licenses/LICENSE-2.0
Packit 63bb0d
//
Packit 63bb0d
//  Unless required by applicable law or agreed to in writing, software
Packit 63bb0d
//  distributed under the License is distributed on an "AS IS" BASIS,
Packit 63bb0d
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 63bb0d
//  See the License for the specific language governing permissions and
Packit 63bb0d
//  limitations under the License.
Packit 63bb0d
Packit 63bb0d
const number = "v1.0.0"
Packit 63bb0d
Packit 63bb0d
var (
Packit 63bb0d
	ua = fmt.Sprintf("Go/%s (%s-%s) go-autorest/adal/%s",
Packit 63bb0d
		runtime.Version(),
Packit 63bb0d
		runtime.GOARCH,
Packit 63bb0d
		runtime.GOOS,
Packit 63bb0d
		number,
Packit 63bb0d
	)
Packit 63bb0d
)
Packit 63bb0d
Packit 63bb0d
// UserAgent returns a string containing the Go version, system architecture and OS, and the adal version.
Packit 63bb0d
func UserAgent() string {
Packit 63bb0d
	return ua
Packit 63bb0d
}
Packit 63bb0d
Packit 63bb0d
// AddToUserAgent adds an extension to the current user agent
Packit 63bb0d
func AddToUserAgent(extension string) error {
Packit 63bb0d
	if extension != "" {
Packit 63bb0d
		ua = fmt.Sprintf("%s %s", ua, extension)
Packit 63bb0d
		return nil
Packit 63bb0d
	}
Packit 63bb0d
	return fmt.Errorf("Extension was empty, User Agent remained as '%s'", ua)
Packit 63bb0d
}