Removed (almost) all remaining init()

This commit is contained in:
Deluan
2020-01-08 10:25:23 -05:00
committed by Deluan Quintão
parent 5d2a7b1db1
commit 23e38ec82f
5 changed files with 34 additions and 23 deletions
+9 -14
View File
@@ -11,20 +11,15 @@ const (
ErrorDataNotFound
)
var (
errors map[int]string
)
func init() {
errors = make(map[int]string)
errors[ErrorGeneric] = "A generic error"
errors[ErrorMissingParameter] = "Required parameter is missing"
errors[ErrorClientTooOld] = "Incompatible Subsonic REST protocol version. Client must upgrade"
errors[ErrorServerTooOld] = "Incompatible Subsonic REST protocol version. Server must upgrade"
errors[ErrorAuthenticationFail] = "Wrong username or password"
errors[ErrorAuthorizationFail] = "User is not authorized for the given operation"
errors[ErrorTrialExpired] = "The trial period for the Subsonic server is over. Please upgrade to Subsonic Premium. Visit subsonic.org for details"
errors[ErrorDataNotFound] = "The requested data was not found"
var errors = map[int]string{
ErrorGeneric: "A generic error",
ErrorMissingParameter: "Required parameter is missing",
ErrorClientTooOld: "Incompatible Subsonic REST protocol version. Client must upgrade",
ErrorServerTooOld: "Incompatible Subsonic REST protocol version. Server must upgrade",
ErrorAuthenticationFail: "Wrong username or password",
ErrorAuthorizationFail: "User is not authorized for the given operation",
ErrorTrialExpired: "The trial period for the Subsonic server is over. Please upgrade to Subsonic Premium. Visit subsonic.org for details",
ErrorDataNotFound: "The requested data was not found",
}
func ErrorMsg(code int) string {