2021-11-02 18:19:31 +00:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strconv"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
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"
|
2021-11-07 13:05:45 +00:00
|
|
|
errNameAndTagsTogether = "name and tags arguments connot be used together"
|
2021-11-02 18:19:31 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func getDuplicateFieldError(field string, name string, rows []int) error {
|
|
|
|
|
|
|
|
var rowsInString []string
|
|
|
|
for _, row := range rows {
|
|
|
|
rowsInString = append(rowsInString, strconv.Itoa(row))
|
|
|
|
}
|
|
|
|
|
2021-11-07 13:05:45 +00:00
|
|
|
return fmt.Errorf("the %v \"%v\" is duplicated in rows: %v", field, name, strings.Join(rowsInString, ","))
|
2021-11-02 18:19:31 +00:00
|
|
|
}
|