29 lines
670 B
Go
29 lines
670 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
)
|
|
|
|
func getLicenseInlfo() (license, []error) {
|
|
var errors []error
|
|
var lic license
|
|
|
|
cmd := exec.Command("dci", "license", "check")
|
|
output, err := cmd.Output()
|
|
if err != nil {
|
|
err = fmt.Errorf("Ошибка выполнения команды dci license check : %s", err)
|
|
errors = append(errors, err)
|
|
}
|
|
lic.LicenseCheck = string(output)
|
|
|
|
cmd = exec.Command("dci", "license", "info")
|
|
output, err = cmd.Output()
|
|
if err != nil {
|
|
err = fmt.Errorf("Ошибка выполнения команды dci license info : %s", err)
|
|
errors = append(errors, err)
|
|
}
|
|
lic.LicenseInfo = string(output)
|
|
return lic, errors
|
|
}
|