refactor: versionModelName should be const, not var
This commit is contained in:
parent
21e530aa0f
commit
68b715306d
|
@ -6,6 +6,10 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func RandVersionCode() string {
|
||||||
|
return gofakeit.LetterN(2)
|
||||||
|
}
|
||||||
|
|
||||||
type VersionCursorConfig struct {
|
type VersionCursorConfig struct {
|
||||||
Code string
|
Code string
|
||||||
}
|
}
|
||||||
|
@ -52,7 +56,3 @@ func NewVersion(tb TestingTB, opts ...func(cfg *VersionConfig)) domain.Version {
|
||||||
|
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
func RandVersionCode() string {
|
|
||||||
return gofakeit.LetterN(2)
|
|
||||||
}
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ type Version struct {
|
||||||
timezone string
|
timezone string
|
||||||
}
|
}
|
||||||
|
|
||||||
var versionModelName = "Version"
|
const versionModelName = "Version"
|
||||||
|
|
||||||
// UnmarshalVersionFromDatabase unmarshals Version from the database.
|
// UnmarshalVersionFromDatabase unmarshals Version from the database.
|
||||||
//
|
//
|
||||||
|
|
|
@ -148,7 +148,6 @@ func (re apiErrorRenderer) domainErrorToAPIError(domainErr domain.Error) apiErro
|
||||||
var err error = domainErr
|
var err error = domainErr
|
||||||
for {
|
for {
|
||||||
var withPath domain.ErrorWithPath
|
var withPath domain.ErrorWithPath
|
||||||
|
|
||||||
if !errors.As(err, &withPath) {
|
if !errors.As(err, &withPath) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue