fix(lint): Continue to apply linter recommandation
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
package models
|
||||
|
||||
// UserInputParams
|
||||
// UserInputParams is a struct containing all fields that can be useful for project generation.
|
||||
type UserInputParams struct {
|
||||
DB bool
|
||||
GoModuleName *string
|
||||
|
@ -6,9 +6,10 @@ import (
|
||||
"github.com/juju/errors"
|
||||
)
|
||||
|
||||
// APITypeName
|
||||
// APITypeName is a type used as an enum for possible API Type Name.
|
||||
type APITypeName string
|
||||
|
||||
//nolint:exported // keeping the enum simple and redeable.
|
||||
const (
|
||||
APITypeName_GIN_GONIC APITypeName = "Gin Gonic"
|
||||
APITypeName_GO_SWAGGER APITypeName = "Go Swagger"
|
||||
@ -16,7 +17,7 @@ const (
|
||||
APITypeName_NULL APITypeName = ""
|
||||
)
|
||||
|
||||
// GetListOfAPITypeName returns a list of APITypeName
|
||||
// GetListOfAPITypeName returns a list of APITypeName.
|
||||
func GetListOfAPITypeName() []APITypeName {
|
||||
return []APITypeName{
|
||||
APITypeName_GIN_GONIC,
|
||||
@ -25,7 +26,7 @@ func GetListOfAPITypeName() []APITypeName {
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid validates enum values
|
||||
// IsValid validates enum values.
|
||||
func (e APITypeName) IsValid() bool {
|
||||
for _, v := range GetListOfAPITypeName() {
|
||||
if e == v {
|
||||
@ -36,6 +37,7 @@ func (e APITypeName) IsValid() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// NewAPITypeName return a APITypeName based on a given string.
|
||||
func NewAPITypeName(in string) (APITypeName, error) {
|
||||
out := APITypeName_NULL
|
||||
if in != "" {
|
||||
@ -47,9 +49,8 @@ func NewAPITypeName(in string) (APITypeName, error) {
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// NewAPITypeNameFromInput
|
||||
// NewAPITypeNameFromInput will try to sluggify a given string and make it match with a APITypeName.
|
||||
func NewAPITypeNameFromInput(in string) (APITypeName, error) {
|
||||
|
||||
in = strings.ToLower(in)
|
||||
in = strings.ReplaceAll(in, " ", "-")
|
||||
in = strings.ReplaceAll(in, "_", "-")
|
||||
|
@ -1,8 +1,9 @@
|
||||
package models
|
||||
|
||||
// DependencyName
|
||||
// DependencyName is a type used as an enum for possible Dependency Name.
|
||||
type DependencyName string
|
||||
|
||||
//nolint:exported // keeping the enum simple and redeable.
|
||||
const (
|
||||
DependencyName_GIT DependencyName = "Git"
|
||||
DependencyName_GOLANG DependencyName = "Golang"
|
||||
|
Reference in New Issue
Block a user