feat: update linter config and deprecation notice (#4399)

- Add `gofmt` rewrite-rules to `.golangci.yml` for code formatting
consistency.
- Update deprecation comment in `gpage.go` to specify removal in version
3.0.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
houseme
2025-08-29 15:26:56 +08:00
committed by GitHub
parent 94cc233325
commit bea060af4c
3 changed files with 16 additions and 0 deletions

View File

@ -36,6 +36,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Golang ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:

View File

@ -196,6 +196,19 @@ formatters:
no-lex-order: false
gofmt:
simplify: true
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
- pattern: 'reflect.Ptr'
replacement: 'reflect.Pointer'
- pattern: 'ioutil.ReadAll'
replacement: 'io.ReadAll'
- pattern: 'ioutil.WriteFile'
replacement: 'os.WriteFile'
- pattern: 'ioutil.ReadFile'
replacement: 'os.ReadFile'
- pattern: 'ioutil.NopCloser'
replacement: 'io.NopCloser'
goimports:
local-prefixes:
- github.com/gogf/gf/v2

View File

@ -7,6 +7,7 @@
// Package gpage provides useful paging functionality for web pages.
//
// Deprecated: wrap this pagination html content in business layer.
// Will be removed in version 3.0.
package gpage
import (