Add sync command
This commit is contained in:
commit
5e6a5e23fd
18 changed files with 1077 additions and 0 deletions
27
config/errors.go
Normal file
27
config/errors.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"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"
|
||||
)
|
||||
|
||||
func getDuplicateFieldError(field string, name string, rows []int) error {
|
||||
|
||||
var rowsInString []string
|
||||
for _, row := range rows {
|
||||
rowsInString = append(rowsInString, strconv.Itoa(row))
|
||||
}
|
||||
|
||||
errorMessage := fmt.Sprintf("The %v \"%v\" is duplicated in rows: %v", field, name, strings.Join(rowsInString, ","))
|
||||
|
||||
return errors.New(errorMessage)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue