From c9e5a6a602a6d8b329161a2a14c812325cc59abe Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 2 Jun 2017 17:10:27 -0700 Subject: [PATCH] client: define default version as a constant --- omaha/client/client.go | 6 +++++- omaha/client/machine_linux.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/omaha/client/client.go b/omaha/client/client.go index 3be8c44..b1b8a16 100644 --- a/omaha/client/client.go +++ b/omaha/client/client.go @@ -25,6 +25,10 @@ import ( "github.com/coreos/go-omaha/omaha" ) +const ( + defaultClientVersion = "go-omaha" +) + // Client supports managing multiple apps using a single server. type Client struct { apiClient *httpClient @@ -53,7 +57,7 @@ func New(serverURL, userID string) (*Client, error) { c := &Client{ apiClient: newHTTPClient(), - clientVersion: "go-omaha", + clientVersion: defaultClientVersion, userID: userID, sessionID: uuid.NewV4().String(), apps: make(map[string]*AppClient), diff --git a/omaha/client/machine_linux.go b/omaha/client/machine_linux.go index 3661318..a666d99 100644 --- a/omaha/client/machine_linux.go +++ b/omaha/client/machine_linux.go @@ -60,7 +60,7 @@ func NewMachineClient(serverURL string) (*Client, error) { c := &Client{ apiClient: newHTTPClient(), - clientVersion: "go-omaha", + clientVersion: defaultClientVersion, userID: string(machineID), sessionID: string(bootID), isMachine: true,