Update to the latest required packages

This commit is contained in:
Mikołaj Pęczkowski 2024-03-24 15:17:49 +01:00
parent 5445ce1ccf
commit 14dcb9a66e
5 changed files with 120 additions and 111 deletions

View file

@ -61,10 +61,6 @@ func ParseCliArguments(name, description string, arguments []string) (CliArgumen
return CliArguments{}, errors.New(parser.Usage("Please follow this help"))
}
if !syncCMD.Happened() && !(*version) && !statusCMD.Happened() {
return CliArguments{}, errors.New(errNoCommand)
}
if *limitName != "" && len(*limitTags) != 0 {
return CliArguments{}, errors.New(errNameAndTagsTogether)
}

View file

@ -3,6 +3,7 @@ package config
import (
"fmt"
"os"
"strings"
"testing"
)
@ -47,8 +48,8 @@ func TestParsingWithoutCommand(t *testing.T) {
if err == nil {
t.Errorf("Expected error, not results: %v", results)
}
if err.Error() != errNoCommand {
t.Errorf("Expected to get \"%v\", instead of this got \"%v\"", errNoCommand, err.Error())
if !strings.Contains(err.Error(), "Please follow this help") {
t.Errorf("Expected the error contains \"Please follow this help\", but as a result received: \"%v\"", err.Error())
}
}

View file

@ -7,7 +7,6 @@ import (
)
const (
errNoCommand = "at least one command must be specified, use help to get commands"
errNotSupportedType = "not supported configuration type"
errMissingWorkspaceField = "missing required \"workspace\" field"
errMissingSrcField = "missing required field the \"src\" in row %v"