Этот коммит содержится в:
Jesús Espino
2018-03-29 16:04:54 +02:00
коммит произвёл Harrison Healey
родитель eb48292a3a
Коммит 014a3b6a60
28 изменённых файлов: 44 добавлений и 44 удалений

Просмотреть файл

@@ -573,7 +573,7 @@ func TestAdminResetPassword(t *testing.T) {
Client.SetTeamId(team.Id) Client.SetTeamId(team.Id)
if _, err := Client.AdminResetPassword(user.Id, "newpwd1"); err == nil { if _, err := Client.AdminResetPassword(user.Id, "newpwd1"); err == nil {
t.Fatal("Should have errored - not sytem admin") t.Fatal("Should have errored - not system admin")
} }
} }

Просмотреть файл

@@ -38,7 +38,7 @@ func TestLoadTestSetupCommands(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableTesting = true }) th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableTesting = true })
rs := Client.Must(Client.Command(channel.Id, "/test setup fuzz 1 1 1")).Data.(*model.CommandResponse) rs := Client.Must(Client.Command(channel.Id, "/test setup fuzz 1 1 1")).Data.(*model.CommandResponse)
if rs.Text != "Created enviroment" { if rs.Text != "Created environment" {
t.Fatal(rs.Text) t.Fatal(rs.Text)
} }

Просмотреть файл

@@ -32,7 +32,7 @@ func TestMeCommand(t *testing.T) {
} else { } else {
if p1.Posts[p1.Order[0]].Message != `*hello*` { if p1.Posts[p1.Order[0]].Message != `*hello*` {
t.Log(p1.Posts[p1.Order[0]].Message) t.Log(p1.Posts[p1.Order[0]].Message)
t.Fatal("invalid shrug reponse") t.Fatal("invalid shrug response")
} }
} }
} }

Просмотреть файл

@@ -32,7 +32,7 @@ func TestShrugCommand(t *testing.T) {
} else { } else {
if p1.Posts[p1.Order[0]].Message != `¯\\\_(ツ)\_/¯` { if p1.Posts[p1.Order[0]].Message != `¯\\\_(ツ)\_/¯` {
t.Log(p1.Posts[p1.Order[0]].Message) t.Log(p1.Posts[p1.Order[0]].Message)
t.Fatal("invalid shrug reponse") t.Fatal("invalid shrug response")
} }
} }
} }

Просмотреть файл

@@ -40,7 +40,7 @@ func logClient(c *Context, w http.ResponseWriter, r *http.Request) {
lvl := m["level"] lvl := m["level"]
msg := m["message"] msg := m["message"]
// filter out javascript errors from franz that are poluting the log files // filter out javascript errors from franz that are polluting the log files
if strings.Contains(msg, "/franz") { if strings.Contains(msg, "/franz") {
forceToDebug = true forceToDebug = true
} }

Просмотреть файл

@@ -428,7 +428,7 @@ func TestOAuthRegenerateAppSecret(t *testing.T) {
} }
if app2.ClientSecret == oauthApp.ClientSecret { if app2.ClientSecret == oauthApp.ClientSecret {
t.Fatal("Should have been diferent client Secrets") t.Fatal("Should have been different client Secrets")
} }
} }
} }

Просмотреть файл

@@ -931,7 +931,7 @@ func TestUpdateTeamMemberRoles(t *testing.T) {
t.Fatal("Should have worked, user is team admin and has the ability to manage permissions on this team.") t.Fatal("Should have worked, user is team admin and has the ability to manage permissions on this team.")
// Note to anyone who thinks this test is wrong: // Note to anyone who thinks this test is wrong:
// This operation will not effect the system admin's permissions because they have global access to all teams. // This operation will not effect the system admin's permissions because they have global access to all teams.
// Their team level permissions are irrelavent. A team admin should be able to manage team level permissions. // Their team level permissions are irrelevant. A team admin should be able to manage team level permissions.
} }
// System admins should be able to manipulate permission no matter what their team level permissions are. // System admins should be able to manipulate permission no matter what their team level permissions are.

Просмотреть файл

@@ -743,7 +743,7 @@ func viewChannel(c *Context, w http.ResponseWriter, r *http.Request) {
c.App.UpdateLastActivityAtIfNeeded(c.Session) c.App.UpdateLastActivityAtIfNeeded(c.Session)
// Returning {"status": "OK", ...} for backwards compatability // Returning {"status": "OK", ...} for backwards compatibility
resp := &model.ChannelViewResponse{ resp := &model.ChannelViewResponse{
Status: "OK", Status: "OK",
LastViewedAtTimes: times, LastViewedAtTimes: times,

Просмотреть файл

@@ -155,7 +155,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.handleFunc(c, w, r) h.handleFunc(c, w, r)
} }
// Handle errors that have occured // Handle errors that have occurred
if c.Err != nil { if c.Err != nil {
c.Err.Translate(c.T) c.Err.Translate(c.T)
c.Err.RequestId = c.RequestId c.Err.RequestId = c.RequestId

Просмотреть файл

@@ -129,7 +129,7 @@ func TestGetRolesByNames(t *testing.T) {
assert.Contains(t, received, role2) assert.Contains(t, received, role2)
assert.Contains(t, received, role3) assert.Contains(t, received, role3)
// Check a list of non-existant roles. // Check a list of non-existent roles.
received, resp = th.Client.GetRolesByNames([]string{model.NewId(), model.NewId()}) received, resp = th.Client.GetRolesByNames([]string{model.NewId(), model.NewId()})
CheckNoError(t, resp) CheckNoError(t, resp)

Просмотреть файл

@@ -1676,7 +1676,7 @@ func TestUpdateTeamMemberRoles(t *testing.T) {
// Note from API v3 // Note from API v3
// Note to anyone who thinks this (above) test is wrong: // Note to anyone who thinks this (above) test is wrong:
// This operation will not affect the system admin's permissions because they have global access to all teams. // This operation will not affect the system admin's permissions because they have global access to all teams.
// Their team level permissions are irrelavent. A team admin should be able to manage team level permissions. // Their team level permissions are irrelevant. A team admin should be able to manage team level permissions.
// System admins should be able to manipulate permission no matter what their team level permissions are. // System admins should be able to manipulate permission no matter what their team level permissions are.
// system admin promotes user 2 // system admin promotes user 2

Просмотреть файл

@@ -19,7 +19,7 @@ func TestCheckIfRolesGrantPermission(t *testing.T) {
shouldGrant bool shouldGrant bool
}{ }{
{[]string{model.SYSTEM_ADMIN_ROLE_ID}, model.PERMISSION_MANAGE_SYSTEM.Id, true}, {[]string{model.SYSTEM_ADMIN_ROLE_ID}, model.PERMISSION_MANAGE_SYSTEM.Id, true},
{[]string{model.SYSTEM_ADMIN_ROLE_ID}, "non-existant-permission", false}, {[]string{model.SYSTEM_ADMIN_ROLE_ID}, "non-existent-permission", false},
{[]string{model.CHANNEL_USER_ROLE_ID}, model.PERMISSION_READ_CHANNEL.Id, true}, {[]string{model.CHANNEL_USER_ROLE_ID}, model.PERMISSION_READ_CHANNEL.Id, true},
{[]string{model.CHANNEL_USER_ROLE_ID}, model.PERMISSION_MANAGE_SYSTEM.Id, false}, {[]string{model.CHANNEL_USER_ROLE_ID}, model.PERMISSION_MANAGE_SYSTEM.Id, false},
{[]string{model.SYSTEM_ADMIN_ROLE_ID, model.CHANNEL_USER_ROLE_ID}, model.PERMISSION_MANAGE_SYSTEM.Id, true}, {[]string{model.SYSTEM_ADMIN_ROLE_ID, model.CHANNEL_USER_ROLE_ID}, model.PERMISSION_MANAGE_SYSTEM.Id, true},

Просмотреть файл

@@ -252,7 +252,7 @@ func (a *App) WaitForChannelMembership(channelId string, userId string) {
return return
} }
// If we recieved a error but it wasn't a missing channel member then return // If we received a error but it wasn't a missing channel member then return
if result.Err.Id != store.MISSING_CHANNEL_MEMBER_ERROR { if result.Err.Id != store.MISSING_CHANNEL_MEMBER_ERROR {
return return
} }

Просмотреть файл

@@ -204,7 +204,7 @@ func (me *LoadTestProvider) SetupCommand(a *App, args *model.CommandArgs, messag
doFuzz) doFuzz)
} }
return &model.CommandResponse{Text: "Created enviroment", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL} return &model.CommandResponse{Text: "Created environment", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
} }
func (me *LoadTestProvider) UsersCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse { func (me *LoadTestProvider) UsersCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse {

Просмотреть файл

@@ -79,7 +79,7 @@ func TestDiagnostics(t *testing.T) {
t.Fail() t.Fail()
} }
case <-time.After(time.Second * 1): case <-time.After(time.Second * 1):
t.Fatal("Did not recieve ID message") t.Fatal("Did not receive ID message")
} }
t.Run("Send", func(t *testing.T) { t.Run("Send", func(t *testing.T) {
@@ -94,7 +94,7 @@ func TestDiagnostics(t *testing.T) {
t.Fail() t.Fail()
} }
case <-time.After(time.Second * 1): case <-time.After(time.Second * 1):
t.Fatal("Did not recieve diagnostic") t.Fatal("Did not receive diagnostic")
} }
}) })
@@ -163,7 +163,7 @@ func TestDiagnostics(t *testing.T) {
case <-data: case <-data:
t.Fatal("Should not send diagnostics when they are disabled") t.Fatal("Should not send diagnostics when they are disabled")
case <-time.After(time.Second * 1): case <-time.After(time.Second * 1):
// Did not recieve diagnostics // Did not receive diagnostics
} }
}) })
} }

Просмотреть файл

@@ -1338,11 +1338,11 @@ func TestImportImportChannel(t *testing.T) {
t.Fatalf("Failed to get channel count.") t.Fatalf("Failed to get channel count.")
} }
// Do a valid channel in apply mode with a nonexistant team. // Do a valid channel in apply mode with a non-existent team.
data.Name = ptrStr("channelname") data.Name = ptrStr("channelname")
data.Team = ptrStr(model.NewId()) data.Team = ptrStr(model.NewId())
if err := th.App.ImportChannel(&data, false); err == nil { if err := th.App.ImportChannel(&data, false); err == nil {
t.Fatalf("Expected error due to non-existant team (apply mode).") t.Fatalf("Expected error due to non-existent team (apply mode).")
} }
// Check that no more channels are in the DB. // Check that no more channels are in the DB.
@@ -2501,7 +2501,7 @@ func TestImportImportDirectChannel(t *testing.T) {
model.NewId(), model.NewId(),
} }
if err := th.App.ImportDirectChannel(&data, true); err != nil { if err := th.App.ImportDirectChannel(&data, true); err != nil {
t.Fatalf("Expected success as cannot validate existance of channel members in dry run mode.") t.Fatalf("Expected success as cannot validate existence of channel members in dry run mode.")
} }
// Check that no more channels are in the DB. // Check that no more channels are in the DB.
@@ -2515,7 +2515,7 @@ func TestImportImportDirectChannel(t *testing.T) {
model.NewId(), model.NewId(),
} }
if err := th.App.ImportDirectChannel(&data, true); err != nil { if err := th.App.ImportDirectChannel(&data, true); err != nil {
t.Fatalf("Expected success as cannot validate existance of channel members in dry run mode.") t.Fatalf("Expected success as cannot validate existence of channel members in dry run mode.")
} }
// Check that no more channels are in the DB. // Check that no more channels are in the DB.

Просмотреть файл

@@ -47,7 +47,7 @@ func resetCmdF(command *cobra.Command, args []string) error {
} }
a.Srv.Store.DropAllTables() a.Srv.Store.DropAllTables()
cmd.CommandPrettyPrintln("Database sucessfully reset") cmd.CommandPrettyPrintln("Database successfully reset")
return nil return nil
} }

Просмотреть файл

@@ -576,7 +576,7 @@ func migrateAuthToLdapCmdF(command *cobra.Command, args []string) error {
return errors.New("Error while migrating users: " + err.Error()) return errors.New("Error while migrating users: " + err.Error())
} }
cmd.CommandPrettyPrintln("Sucessfully migrated accounts.") cmd.CommandPrettyPrintln("Successfully migrated accounts.")
} }
return nil return nil
@@ -631,7 +631,7 @@ func migrateAuthToSamlCmdF(command *cobra.Command, args []string) error {
return errors.New("Error while migrating users: " + err.Error()) return errors.New("Error while migrating users: " + err.Error())
} }
l4g.Close() l4g.Close()
cmd.CommandPrettyPrintln("Sucessfully migrated accounts.") cmd.CommandPrettyPrintln("Successfully migrated accounts.")
} }
return nil return nil

Просмотреть файл

@@ -66,7 +66,7 @@ func (watcher *Watcher) Stop() {
func (watcher *Watcher) PollAndNotify() { func (watcher *Watcher) PollAndNotify() {
if result := <-watcher.srv.Store.Job().GetAllByStatus(model.JOB_STATUS_PENDING); result.Err != nil { if result := <-watcher.srv.Store.Job().GetAllByStatus(model.JOB_STATUS_PENDING); result.Err != nil {
l4g.Error("Error occured getting all pending statuses: %v", result.Err.Error()) l4g.Error("Error occurred getting all pending statuses: %v", result.Err.Error())
} else { } else {
jobs := result.Data.([]*model.Job) jobs := result.Data.([]*model.Job)

Просмотреть файл

@@ -113,7 +113,7 @@ func manualTest(c *api.Context, w http.ResponseWriter, r *http.Request) {
return return
} }
// Respond with an auth token this can be overriden by a specific test as required // Respond with an auth token this can be overridden by a specific test as required
sessionCookie := &http.Cookie{ sessionCookie := &http.Cookie{
Name: model.SESSION_COOKIE_TOKEN, Name: model.SESSION_COOKIE_TOKEN,
Value: client.AuthToken, Value: client.AuthToken,

Просмотреть файл

@@ -72,7 +72,7 @@ type Client struct {
ServerVersion string ServerVersion string
} }
// NewClient constructs a new client with convienence methods for talking to // NewClient constructs a new client with convenience methods for talking to
// the server. // the server.
func NewClient(url string) *Client { func NewClient(url string) *Client {
return &Client{url, url + API_URL_SUFFIX_V3, &http.Client{}, "", "", "", "", "", ""} return &Client{url, url + API_URL_SUFFIX_V3, &http.Client{}, "", "", "", "", "", ""}
@@ -257,7 +257,7 @@ func (c *Client) clearExtraProperties() {
// General Routes Section // General Routes Section
// GetClientProperties returns properties needed by the client to show/hide // GetClientProperties returns properties needed by the client to show/hide
// certian features. It returns a map of strings. // certain features. It returns a map of strings.
func (c *Client) GetClientProperties() (map[string]string, *AppError) { func (c *Client) GetClientProperties() (map[string]string, *AppError) {
c.clearExtraProperties() c.clearExtraProperties()
if r, err := c.DoApiGet(c.GetGeneralRoute()+"/client_props", "", ""); err != nil { if r, err := c.DoApiGet(c.GetGeneralRoute()+"/client_props", "", ""); err != nil {
@@ -2231,7 +2231,7 @@ func (c *Client) GetCustomEmojiImageUrl(id string) string {
// Uploads a x509 base64 Certificate or Private Key file to be used with SAML. // Uploads a x509 base64 Certificate or Private Key file to be used with SAML.
// data byte array is required and needs to be a Multi-Part with 'certificate' as the field name // data byte array is required and needs to be a Multi-Part with 'certificate' as the field name
// contentType is also required. Returns nil if succesful, otherwise returns an AppError // contentType is also required. Returns nil if successful, otherwise returns an AppError
func (c *Client) UploadCertificateFile(data []byte, contentType string) *AppError { func (c *Client) UploadCertificateFile(data []byte, contentType string) *AppError {
url := c.ApiUrl + "/admin/add_certificate" url := c.ApiUrl + "/admin/add_certificate"
rq, _ := http.NewRequest("POST", url, bytes.NewReader(data)) rq, _ := http.NewRequest("POST", url, bytes.NewReader(data))

Просмотреть файл

@@ -1128,7 +1128,7 @@ type LdapSettings struct {
IdAttribute *string IdAttribute *string
PositionAttribute *string PositionAttribute *string
// Syncronization // Synchronization
SyncIntervalMinutes *int SyncIntervalMinutes *int
// Advanced // Advanced

Просмотреть файл

@@ -26,7 +26,7 @@ type WebSocketClient struct {
ListenError *AppError ListenError *AppError
} }
// NewWebSocketClient constructs a new WebSocket client with convienence // NewWebSocketClient constructs a new WebSocket client with convenience
// methods for talking to the server. // methods for talking to the server.
func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError) { func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError) {
conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX_V3+"/users/websocket", nil) conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX_V3+"/users/websocket", nil)
@@ -51,7 +51,7 @@ func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError) {
return client, nil return client, nil
} }
// NewWebSocketClient4 constructs a new WebSocket client with convienence // NewWebSocketClient4 constructs a new WebSocket client with convenience
// methods for talking to the server. Uses the v4 endpoint. // methods for talking to the server. Uses the v4 endpoint.
func NewWebSocketClient4(url, authToken string) (*WebSocketClient, *AppError) { func NewWebSocketClient4(url, authToken string) (*WebSocketClient, *AppError) {
conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX+"/websocket", nil) conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX+"/websocket", nil)

Просмотреть файл

@@ -750,7 +750,7 @@ func (s SqlChannelStore) SaveMember(member *model.ChannelMember) store.StoreChan
if err := transaction.Commit(); err != nil { if err := transaction.Commit(); err != nil {
result.Err = model.NewAppError("SqlChannelStore.SaveMember", "store.sql_channel.save_member.commit_transaction.app_error", nil, err.Error(), http.StatusInternalServerError) result.Err = model.NewAppError("SqlChannelStore.SaveMember", "store.sql_channel.save_member.commit_transaction.app_error", nil, err.Error(), http.StatusInternalServerError)
} }
// If sucessfull record members have changed in channel // If successfull record members have changed in channel
if mu := <-s.extraUpdated(channel); mu.Err != nil { if mu := <-s.extraUpdated(channel); mu.Err != nil {
result.Err = mu.Err result.Err = mu.Err
} }
@@ -1065,7 +1065,7 @@ func (s SqlChannelStore) RemoveMember(channelId string, userId string) store.Sto
if err != nil { if err != nil {
result.Err = model.NewAppError("SqlChannelStore.RemoveMember", "store.sql_channel.remove_member.app_error", nil, "channel_id="+channelId+", user_id="+userId+", "+err.Error(), http.StatusInternalServerError) result.Err = model.NewAppError("SqlChannelStore.RemoveMember", "store.sql_channel.remove_member.app_error", nil, "channel_id="+channelId+", user_id="+userId+", "+err.Error(), http.StatusInternalServerError)
} else { } else {
// If sucessfull record members have changed in channel // If successfull record members have changed in channel
if mu := <-s.extraUpdated(channel); mu.Err != nil { if mu := <-s.extraUpdated(channel); mu.Err != nil {
result.Err = mu.Err result.Err = mu.Err
} }

Просмотреть файл

@@ -1463,11 +1463,11 @@ func testGetMember(t *testing.T, ss store.Store) {
store.Must(ss.Channel().SaveMember(m2)) store.Must(ss.Channel().SaveMember(m2))
if result := <-ss.Channel().GetMember(model.NewId(), userId); result.Err == nil { if result := <-ss.Channel().GetMember(model.NewId(), userId); result.Err == nil {
t.Fatal("should've failed to get member for non-existant channel") t.Fatal("should've failed to get member for non-existent channel")
} }
if result := <-ss.Channel().GetMember(c1.Id, model.NewId()); result.Err == nil { if result := <-ss.Channel().GetMember(c1.Id, model.NewId()); result.Err == nil {
t.Fatal("should've failed to get member for non-existant user") t.Fatal("should've failed to get member for non-existent user")
} }
if result := <-ss.Channel().GetMember(c1.Id, userId); result.Err != nil { if result := <-ss.Channel().GetMember(c1.Id, userId); result.Err != nil {

Просмотреть файл

@@ -50,7 +50,7 @@ func TestFindConfigFile(t *testing.T) {
} }
func TestConfigFromEnviroVars(t *testing.T) { func TestConfigFromEnviroVars(t *testing.T) {
os.Setenv("MM_TEAMSETTINGS_SITENAME", "From Enviroment") os.Setenv("MM_TEAMSETTINGS_SITENAME", "From Environment")
os.Setenv("MM_TEAMSETTINGS_CUSTOMBRANDTEXT", "Custom Brand") os.Setenv("MM_TEAMSETTINGS_CUSTOMBRANDTEXT", "Custom Brand")
os.Setenv("MM_SERVICESETTINGS_ENABLECOMMANDS", "false") os.Setenv("MM_SERVICESETTINGS_ENABLECOMMANDS", "false")
os.Setenv("MM_SERVICESETTINGS_READTIMEOUT", "400") os.Setenv("MM_SERVICESETTINGS_READTIMEOUT", "400")
@@ -59,20 +59,20 @@ func TestConfigFromEnviroVars(t *testing.T) {
cfg, cfgPath, err := LoadConfig("config.json") cfg, cfgPath, err := LoadConfig("config.json")
require.Nil(t, err) require.Nil(t, err)
if cfg.TeamSettings.SiteName != "From Enviroment" { if cfg.TeamSettings.SiteName != "From Environment" {
t.Fatal("Couldn't read config from enviroment var") t.Fatal("Couldn't read config from environment var")
} }
if *cfg.TeamSettings.CustomBrandText != "Custom Brand" { if *cfg.TeamSettings.CustomBrandText != "Custom Brand" {
t.Fatal("Couldn't read config from enviroment var") t.Fatal("Couldn't read config from environment var")
} }
if *cfg.ServiceSettings.EnableCommands { if *cfg.ServiceSettings.EnableCommands {
t.Fatal("Couldn't read config from enviroment var") t.Fatal("Couldn't read config from environment var")
} }
if *cfg.ServiceSettings.ReadTimeout != 400 { if *cfg.ServiceSettings.ReadTimeout != 400 {
t.Fatal("Couldn't read config from enviroment var") t.Fatal("Couldn't read config from environment var")
} }
os.Unsetenv("MM_TEAMSETTINGS_SITENAME") os.Unsetenv("MM_TEAMSETTINGS_SITENAME")

Просмотреть файл

@@ -96,7 +96,7 @@ func GetUserTranslations(locale string) i18n.TranslateFunc {
func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string) { func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string) {
// This is for checking against locales like pt_BR or zn_CN // This is for checking against locales like pt_BR or zn_CN
headerLocaleFull := strings.Split(r.Header.Get("Accept-Language"), ",")[0] headerLocaleFull := strings.Split(r.Header.Get("Accept-Language"), ",")[0]
// This is for checking agains locales like en, es // This is for checking against locales like en, es
headerLocale := strings.Split(strings.Split(r.Header.Get("Accept-Language"), ",")[0], "-")[0] headerLocale := strings.Split(strings.Split(r.Header.Get("Accept-Language"), ",")[0], "-")[0]
defaultLocale := *settings.DefaultClientLocale defaultLocale := *settings.DefaultClientLocale
if locales[headerLocaleFull] != "" { if locales[headerLocaleFull] != "" {

Просмотреть файл

@@ -82,7 +82,7 @@ func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) {
case "Password:": case "Password:":
return []byte(a.password), nil return []byte(a.password), nil
default: default:
return nil, errors.New("Unkown fromServer") return nil, errors.New("Unknown fromServer")
} }
} }
return nil, nil return nil, nil