mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-28 12:16:17 +01:00
golint fixed for modules/avatar
This commit is contained in:
parent
081c2a9395
commit
3c87c57d96
2 changed files with 5 additions and 4 deletions
|
@ -355,7 +355,7 @@ func (u *User) UploadAvatar(data []byte) error {
|
|||
return fmt.Errorf("Decode: %v", err)
|
||||
}
|
||||
|
||||
m := resize.Resize(avatar.AVATAR_SIZE, avatar.AVATAR_SIZE, img, resize.NearestNeighbor)
|
||||
m := resize.Resize(avatar.AvatarSize, avatar.AvatarSize, img, resize.NearestNeighbor)
|
||||
|
||||
sess := x.NewSession()
|
||||
defer sessionRelease(sess)
|
||||
|
|
|
@ -14,9 +14,10 @@ import (
|
|||
"github.com/issue9/identicon"
|
||||
)
|
||||
|
||||
const AVATAR_SIZE = 290
|
||||
// AvatarSize returns avatar's size
|
||||
const AvatarSize = 290
|
||||
|
||||
// RandomImage generates and returns a random avatar image unique to input data
|
||||
// RandomImageSize generates and returns a random avatar image unique to input data
|
||||
// in custom size (height and width).
|
||||
func RandomImageSize(size int, data []byte) (image.Image, error) {
|
||||
randExtent := len(palette.WebSafe) - 32
|
||||
|
@ -39,5 +40,5 @@ func RandomImageSize(size int, data []byte) (image.Image, error) {
|
|||
// RandomImage generates and returns a random avatar image unique to input data
|
||||
// in default size (height and width).
|
||||
func RandomImage(data []byte) (image.Image, error) {
|
||||
return RandomImageSize(AVATAR_SIZE, data)
|
||||
return RandomImageSize(AvatarSize, data)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue