client: define default version as a constant

This commit is contained in:
Michael Marineau 2017-06-02 17:10:27 -07:00
parent d40844181a
commit c9e5a6a602
2 changed files with 6 additions and 2 deletions

View File

@ -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),

View File

@ -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,