MM-22051: Remove ToJson from model (part 1) (#18005)
https://mattermost.atlassian.net/browse/MM-22051 ```release-note Removed the following methods/functions: (ad *AccessData) ToJson() (ar *AccessResponse) ToJson() (ar *AnalyticsRow) ToJson() (ar AnalyticsRows) ToJson() (o *Audit) ToJson() (o Audits) ToJson() (ad *AuthData) ToJson() (ar *AuthorizeRequest) ToJson() (o *ChannelPatch) ToJson() (o *ChannelsWithCount) ToJson() (o *ChannelCounts) ToJson() (o *ChannelData) ToJson() (o *ChannelMembers) ToJson() (o *ChannelUnread) ToJson() (o *ChannelUnreadAt) ToJson() (o *ChannelStats) ToJson() (o *ChannelView) ToJson() (o *ChannelViewResponse) ToJson() (o *ClusterDiscovery) ToJson() (ci *ClusterInfo) ToJson() (cs *ClusterStats) ToJson() (o *Command) ToJson() CommandListToJson(l []*Command) string (o *CommandArgs) ToJson() (cmr *CommandMoveRequest) ToJson() (o *CommandResponse) ToJson() (c *Compliance) ToJson() (c Compliances) ToJson() (o *Config) ToJson() EmojiListToJson(emojiList []*Emoji) ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1ae1c38c9f
Коммит
0d075c32db
@@ -4,6 +4,7 @@
|
||||
package testlib
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
@@ -206,8 +207,13 @@ func setupConfig(configDir string) error {
|
||||
return errors.Wrapf(err, "failed to create config directory %s", configDir)
|
||||
}
|
||||
|
||||
buf, err := json.Marshal(config)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to marshal config: %v", err)
|
||||
}
|
||||
|
||||
configJSON := path.Join(configDir, "config.json")
|
||||
err = ioutil.WriteFile(configJSON, []byte(config.ToJson()), 0644)
|
||||
err = ioutil.WriteFile(configJSON, buf, 0644)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to write config to %s", configJSON)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user