OSF: Used model.NewPointer everywhere (#27838)

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2024-08-06 09:15:00 +05:30
коммит произвёл GitHub
родитель f290745496
Коммит c3ed07e679
148 изменённых файлов: 2341 добавлений и 2338 удалений

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

@@ -22,14 +22,14 @@ func makeTestAtmosCamoProxy() *ImageProxy {
configService := &testutils.StaticConfigService{
Cfg: &model.Config{
ServiceSettings: model.ServiceSettings{
SiteURL: model.NewString("https://mattermost.example.com"),
AllowedUntrustedInternalConnections: model.NewString("127.0.0.1"),
SiteURL: model.NewPointer("https://mattermost.example.com"),
AllowedUntrustedInternalConnections: model.NewPointer("127.0.0.1"),
},
ImageProxySettings: model.ImageProxySettings{
Enable: model.NewBool(true),
ImageProxyType: model.NewString(model.ImageProxyTypeAtmosCamo),
RemoteImageProxyURL: model.NewString("http://images.example.com"),
RemoteImageProxyOptions: model.NewString("7e5f3fab20b94782b43cdb022a66985ef28ba355df2c5d5da3c9a05e4b697bac"),
Enable: model.NewPointer(true),
ImageProxyType: model.NewPointer(model.ImageProxyTypeAtmosCamo),
RemoteImageProxyURL: model.NewPointer("http://images.example.com"),
RemoteImageProxyOptions: model.NewPointer("7e5f3fab20b94782b43cdb022a66985ef28ba355df2c5d5da3c9a05e4b697bac"),
},
},
}

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

@@ -125,14 +125,14 @@ func TestOnConfigChange(t *testing.T) {
require.Equal(t, "https://mattermost.example.com", proxy.backend.(*AtmosCamoBackend).siteURL.String())
newConfig := proxy.ConfigService.Config().Clone()
newConfig.ImageProxySettings.ImageProxyType = model.NewString(model.ImageProxyTypeLocal)
newConfig.ImageProxySettings.ImageProxyType = model.NewPointer(model.ImageProxyTypeLocal)
proxy.ConfigService.(*testutils.StaticConfigService).UpdateConfig(newConfig)
require.Equal(t, "https://mattermost.example.com", proxy.backend.(*LocalBackend).baseURL.String())
newConfig = proxy.ConfigService.Config().Clone()
newConfig.ImageProxySettings.ImageProxyType = model.NewString(model.ImageProxyTypeAtmosCamo)
newConfig.ImageProxySettings.ImageProxyType = model.NewPointer(model.ImageProxyTypeAtmosCamo)
proxy.ConfigService.(*testutils.StaticConfigService).UpdateConfig(newConfig)
@@ -146,7 +146,7 @@ func TestOnConfigChange(t *testing.T) {
require.Equal(t, "https://mattermost.example.com", proxy.backend.(*LocalBackend).baseURL.String())
newConfig := proxy.ConfigService.Config().Clone()
newConfig.ServiceSettings.SiteURL = model.NewString("https://new.example.com")
newConfig.ServiceSettings.SiteURL = model.NewPointer("https://new.example.com")
proxy.ConfigService.(*testutils.StaticConfigService).UpdateConfig(newConfig)
@@ -161,7 +161,7 @@ func TestOnConfigChange(t *testing.T) {
require.Equal(t, "https://mattermost.example.com", proxy.backend.(*AtmosCamoBackend).siteURL.String())
newConfig := proxy.ConfigService.Config().Clone()
newConfig.ServiceSettings.SiteURL = model.NewString("https://new.example.com")
newConfig.ServiceSettings.SiteURL = model.NewPointer("https://new.example.com")
proxy.ConfigService.(*testutils.StaticConfigService).UpdateConfig(newConfig)
@@ -176,8 +176,8 @@ func TestOnConfigChange(t *testing.T) {
// require.Equal(t, "7e5f3fab20b94782b43cdb022a66985ef28ba355df2c5d5da3c9a05e4b697bac", proxy.backend.(*AtmosCamoBackend).remoteOptions)
newConfig := proxy.ConfigService.Config().Clone()
newConfig.ImageProxySettings.RemoteImageProxyURL = model.NewString("https://new.example.com")
newConfig.ImageProxySettings.RemoteImageProxyOptions = model.NewString("some other random hash")
newConfig.ImageProxySettings.RemoteImageProxyURL = model.NewPointer("https://new.example.com")
newConfig.ImageProxySettings.RemoteImageProxyOptions = model.NewPointer("some other random hash")
proxy.ConfigService.(*testutils.StaticConfigService).UpdateConfig(newConfig)

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

@@ -22,12 +22,12 @@ func makeTestLocalProxy() *ImageProxy {
configService := &testutils.StaticConfigService{
Cfg: &model.Config{
ServiceSettings: model.ServiceSettings{
SiteURL: model.NewString("https://mattermost.example.com"),
AllowedUntrustedInternalConnections: model.NewString("127.0.0.1"),
SiteURL: model.NewPointer("https://mattermost.example.com"),
AllowedUntrustedInternalConnections: model.NewPointer("127.0.0.1"),
},
ImageProxySettings: model.ImageProxySettings{
Enable: model.NewBool(true),
ImageProxyType: model.NewString(model.ImageProxyTypeLocal),
Enable: model.NewPointer(true),
ImageProxyType: model.NewPointer(model.ImageProxyTypeLocal),
},
},
}