Restructure project directories
Follow the standard of all go projects
This commit is contained in:
parent
741f18efd1
commit
5445ce1ccf
20 changed files with 39 additions and 42 deletions
25
internal/config/errors.go
Normal file
25
internal/config/errors.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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"
|
||||
errNameAndTagsTogether = "name and tags arguments connot be used together"
|
||||
)
|
||||
|
||||
func getDuplicateFieldError(field string, name string, rows []int) error {
|
||||
|
||||
var rowsInString []string
|
||||
for _, row := range rows {
|
||||
rowsInString = append(rowsInString, strconv.Itoa(row))
|
||||
}
|
||||
|
||||
return fmt.Errorf("the %v \"%v\" is duplicated in rows: %v", field, name, strings.Join(rowsInString, ","))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue