Skip to content

Commit

Permalink
Changed code to make it more readable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Cline authored and Jeffrey Cline committed Nov 29, 2017
1 parent ac14281 commit 1436023
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ func withRequestLogging() autorest.SendDecorator {
}

func setUserAgent(client *autorest.Client) {
// if the user agent already has a value append Terraform user agent string
if tfVersion := fmt.Sprintf("HashiCorp-Terraform-v%s", terraform.VersionString()); client.UserAgent != "" {
client.UserAgent = fmt.Sprintf("%s;%s", client.UserAgent, tfVersion)
tfVersion := fmt.Sprintf("HashiCorp-Terraform-v%s", terraform.VersionString())

// if the user agent already has a value append the Terraform user agent string
if curUserAgent := client.UserAgent; curUserAgent != "" {
client.UserAgent = fmt.Sprintf("%s;%s", curUserAgent, tfVersion)
} else {
client.UserAgent = tfVersion
}
Expand Down

0 comments on commit 1436023

Please sign in to comment.