MM-25007: Add staticcheck (#14522)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
21af1f49f1
Коммит
bb172aea71
@@ -136,7 +136,6 @@ func (s *Server) configureAudit(adt *audit.Audit) {
|
||||
filter := adt.MakeFilter(RestLevel, RestContentLevel, RestPermsLevel, CLILevel)
|
||||
formatter := adt.MakeJSONFormatter()
|
||||
formatter.DisableTimestamp = false
|
||||
formatter.Indent = "\n"
|
||||
target, err := audit.NewFileTarget(filter, formatter, opts, maxQueueSize)
|
||||
if err != nil {
|
||||
mlog.Error("cannot configure File audit target", mlog.Err(err))
|
||||
|
||||
@@ -278,7 +278,7 @@ func resizeEmoji(img image.Image, width int, height int) image.Image {
|
||||
func imageToPaletted(img image.Image) *image.Paletted {
|
||||
b := img.Bounds()
|
||||
pm := image.NewPaletted(b, palette.Plan9)
|
||||
draw.FloydSteinberg.Draw(pm, b, img, image.ZP)
|
||||
draw.FloydSteinberg.Draw(pm, b, img, image.Point{})
|
||||
return pm
|
||||
}
|
||||
|
||||
|
||||
@@ -330,8 +330,7 @@ func (a *App) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo {
|
||||
}
|
||||
|
||||
// Copy and save the updated post
|
||||
newPost := &model.Post{}
|
||||
newPost = post.Clone()
|
||||
newPost := post.Clone()
|
||||
|
||||
newPost.Filenames = []string{}
|
||||
newPost.FileIds = fileIds
|
||||
|
||||
@@ -709,7 +709,7 @@ func CreateProfileImage(username string, userId string, initialFont string) ([]b
|
||||
color := colors[int64(seed)%int64(len(colors))]
|
||||
dstImg := image.NewRGBA(image.Rect(0, 0, IMAGE_PROFILE_PIXEL_DIMENSION, IMAGE_PROFILE_PIXEL_DIMENSION))
|
||||
srcImg := image.White
|
||||
draw.Draw(dstImg, dstImg.Bounds(), &image.Uniform{color}, image.ZP, draw.Src)
|
||||
draw.Draw(dstImg, dstImg.Bounds(), &image.Uniform{color}, image.Point{}, draw.Src)
|
||||
size := float64(IMAGE_PROFILE_PIXEL_DIMENSION / 2)
|
||||
|
||||
c := freetype.NewContext()
|
||||
|
||||
Ссылка в новой задаче
Block a user