github.com/stulluk/snapd@v0.0.0-20210611110309-f6d5d5bd24b0/cmd/snap/cmd_version_other.go (about)

     1  // -*- Mode: Go; indent-tabs-mode: t -*-
     2  // +build !linux
     3  
     4  /*
     5   * Copyright (C) 2016 Canonical Ltd
     6   *
     7   * This program is free software: you can redistribute it and/or modify
     8   * it under the terms of the GNU General Public License version 3 as
     9   * published by the Free Software Foundation.
    10   *
    11   * This program is distributed in the hope that it will be useful,
    12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14   * GNU General Public License for more details.
    15   *
    16   * You should have received a copy of the GNU General Public License
    17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    18   *
    19   */
    20  
    21  package main
    22  
    23  import (
    24  	"fmt"
    25  	"runtime"
    26  
    27  	"github.com/snapcore/snapd/client"
    28  	"github.com/snapcore/snapd/i18n"
    29  	"github.com/snapcore/snapd/osutil"
    30  	"github.com/snapcore/snapd/release"
    31  )
    32  
    33  func serverVersion(*client.Client) *client.ServerVersion {
    34  	return &client.ServerVersion{
    35  		Version:       i18n.G("unavailable"),
    36  		Series:        release.Series,
    37  		OSID:          runtime.GOOS,
    38  		OnClassic:     true,
    39  		KernelVersion: fmt.Sprintf("%s (%s)", osutil.KernelVersion(), runtime.GOARCH),
    40  	}
    41  }