mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Golint fixed for modules/setting (#262)
* golint fixed for modules/setting * typo fixed and renamed UNIXSOCKET to UnixSocket
This commit is contained in:
		@@ -47,16 +47,16 @@ func (ctx *APIContext) SetLinkHeader(total, pageSize int) {
 | 
			
		||||
	page := paginater.New(total, pageSize, ctx.QueryInt("page"), 0)
 | 
			
		||||
	links := make([]string, 0, 4)
 | 
			
		||||
	if page.HasNext() {
 | 
			
		||||
		links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"next\"", setting.AppUrl, ctx.Req.URL.Path[1:], page.Next()))
 | 
			
		||||
		links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"next\"", setting.AppURL, ctx.Req.URL.Path[1:], page.Next()))
 | 
			
		||||
	}
 | 
			
		||||
	if !page.IsLast() {
 | 
			
		||||
		links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"last\"", setting.AppUrl, ctx.Req.URL.Path[1:], page.TotalPages()))
 | 
			
		||||
		links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"last\"", setting.AppURL, ctx.Req.URL.Path[1:], page.TotalPages()))
 | 
			
		||||
	}
 | 
			
		||||
	if !page.IsFirst() {
 | 
			
		||||
		links = append(links, fmt.Sprintf("<%s%s?page=1>; rel=\"first\"", setting.AppUrl, ctx.Req.URL.Path[1:]))
 | 
			
		||||
		links = append(links, fmt.Sprintf("<%s%s?page=1>; rel=\"first\"", setting.AppURL, ctx.Req.URL.Path[1:]))
 | 
			
		||||
	}
 | 
			
		||||
	if page.HasPrevious() {
 | 
			
		||||
		links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"prev\"", setting.AppUrl, ctx.Req.URL.Path[1:], page.Previous()))
 | 
			
		||||
		links = append(links, fmt.Sprintf("<%s%s?page=%d>; rel=\"prev\"", setting.AppURL, ctx.Req.URL.Path[1:], page.Previous()))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if len(links) > 0 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user