1nwf / Produx-v2

Types of function parameters can be combined CRT-A0017
Style
Minor
8 months ago2 years old
func(lastId int64, productId int64, field string) string could be replaced with func(lastId, productId int64, field string) string
 64	return posts, err
 65}
 66
 67func createPostsQuery(lastId int64, productId int64, field string) string { 68	var query string
 69	if field != "" {
 70		if lastId == 0 {
func(field string, productId int64, lastId int64, preloadUser bool) ([]Post, error) could be replaced with func(field string, productId, lastId int64, preloadUser bool) ([]Post, error)
 49	*gorm.DB
 50}
 51
 52func (db *DBConn) GetPosts(field string, productId int64, lastId int64, preloadUser bool) ([]Post, error) { 53	var posts []Post
 54	var err error
 55	query := createPostsQuery(lastId, productId, field)