fix(lint): Continue to apply linter recommandation
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Matthieu 'JP' DERASSE
2022-08-03 11:17:15 +00:00
parent 101ca9a79c
commit 660a4ef162
35 changed files with 187 additions and 159 deletions

View File

@ -9,6 +9,7 @@ import (
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
)
// GetAPIType will return the APIType object based on an APITypeName.
func GetAPIType(in models.APITypeName) (APITypeInterface, error) {
if in == "" {
return nil, errors.BadRequestf("missing parameter")
@ -25,6 +26,8 @@ func GetAPIType(in models.APITypeName) (APITypeInterface, error) {
return go_swagger.APIType{}, nil
case models.APITypeName_MOJOLICIOUS:
return mojolicious.APIType{}, nil
case models.APITypeName_NULL:
break
}
return nil, errors.NotFoundf("Unknown Api Type")

View File

@ -1,5 +1,5 @@
package base
// APIType
// APIType struct.
type APIType struct {
}

View File

@ -4,8 +4,7 @@ import (
"github.com/juju/errors"
)
// CheckInitialize
// CheckInitialize will do preliminary check before initializing a new project.
func (a APIType) CheckInitialize() error {
return errors.NotImplementedf("CheckInitialize not implemented for %s", a.GetName())
}

View File

@ -4,6 +4,7 @@ import (
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
)
// GetName return the APITypeName of the APIType.
func (a APIType) GetName() models.APITypeName {
return models.APITypeName_NULL
}

View File

@ -6,7 +6,7 @@ import (
"github.com/juju/errors"
)
// GetInitializeUserInput will ask user to provide information that allow initialization of a project.
func (a APIType) GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error) {
return nil, errors.NotImplementedf("GetInitializeUserInput not implemented for %s", a.GetName())
}

View File

@ -4,6 +4,7 @@ import (
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
)
// GetName return the APITypeName of the APIType.
func (a APIType) GetName() models.APITypeName {
return models.APITypeName_GIN_GONIC
}

View File

@ -10,7 +10,7 @@ import (
log "github.com/sirupsen/logrus"
)
// CheckInitialize
// CheckInitialize will do preliminary check before initializing a new project.
func (a APIType) CheckInitialize() error {
log.Debugf("Starting %s check initialize", string(a.GetName()))

View File

@ -4,6 +4,7 @@ import (
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
)
// GetName return the APITypeName of the APIType.
func (a APIType) GetName() models.APITypeName {
return models.APITypeName_GO_SWAGGER
}

View File

@ -11,7 +11,7 @@ import (
log "github.com/sirupsen/logrus"
)
// GetInitializeUserInput
// GetInitializeUserInput will ask user to provide information that allow initialization of a project.
func (a APIType) GetInitializeUserInput(params *models.UserInputParams) (*models.UserInputParams, error) {
log.Debugf("Starting %s user input", a.GetName())

View File

@ -4,6 +4,7 @@ import (
"git.home.m-and-m.ovh/mderasse/gouick/helpers/models"
)
// GetName return the APITypeName of the APIType.
func (a APIType) GetName() models.APITypeName {
return models.APITypeName_MOJOLICIOUS
}