Remove remaining references to model.NewXX (#28678)
And we remove the deprecated functions to force uses only of the new function. ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3db139f746
Коммит
a258fd80b2
@@ -3,12 +3,6 @@
|
||||
|
||||
package model
|
||||
|
||||
// These functions are deprecated. Please use only NewPointer.
|
||||
func NewBool(b bool) *bool { return &b }
|
||||
func NewInt(n int) *int { return &n }
|
||||
func NewInt64(n int64) *int64 { return &n }
|
||||
func NewString(s string) *string { return &s }
|
||||
|
||||
// NewPointer returns a pointer to the object passed.
|
||||
func NewPointer[T any](t T) *T { return &t }
|
||||
|
||||
|
||||
@@ -808,7 +808,7 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
|
||||
}
|
||||
|
||||
if s.EnableAPIPostDeletion == nil {
|
||||
s.EnableAPIPostDeletion = NewBool(false)
|
||||
s.EnableAPIPostDeletion = NewPointer(false)
|
||||
}
|
||||
|
||||
if s.EnableAPIChannelDeletion == nil {
|
||||
@@ -1141,7 +1141,7 @@ func (s *ExperimentalSettings) SetDefaults() {
|
||||
}
|
||||
|
||||
if s.YoutubeReferrerPolicy == nil {
|
||||
s.YoutubeReferrerPolicy = NewBool(false)
|
||||
s.YoutubeReferrerPolicy = NewPointer(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user