Skip to content

Commit

Permalink
update go to 1.21 (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhy1024 authored Aug 1, 2024
1 parent e6e78c7 commit 0941ad4
Show file tree
Hide file tree
Showing 65 changed files with 409 additions and 318 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.21"
- name: Load go module cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
cache-dependency-path: "ui/pnpm-lock.yaml"
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.21"
- name: Load go module cache
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
cache-dependency-path: "ui/pnpm-lock.yaml"
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.21"
- name: Load go module cache
uses: actions/cache@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.21"
- name: Load go module cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.21"
- name: Load go module cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
# ${{ runner.os }}-cypress-
# - uses: actions/setup-go@v3
# with:
# go-version: "1.18"
# go-version: "1.21"
# - name: Load go module cache
# uses: actions/cache@v3
# with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-e2e-snapshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
cache-dependency-path: "ui/pnpm-lock.yaml"
- uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.21"
- name: Load go module cache
uses: actions/cache@v3
with:
Expand Down
10 changes: 5 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
run:
skip-dirs:
- swaggerspec
- pkg/uiserver
- ui
timeout: 2m

issues:
Expand All @@ -25,12 +21,16 @@ issues:
- text: "G112:"
linters:
- gosec
exclude-dirs:
- swaggerspec
- pkg/uiserver
- ui

linters:
enable:
# Additionally enable some checkers
- asciicheck
- depguard
# - depguard
- dogsled
- durationcheck
- errorlint
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The followings are required for developing TiDB Dashboard:

- git - Version control
- make - Build tool (run common workflows)
- [Golang 1.19+](https://golang.org/) - To compile the server.
- [Golang 1.21+](https://golang.org/) - To compile the server.
- [Node.js 18](https://nodejs.org/) - To compile the front-end.
- [PNPM 8](https://pnpm.io/) - To manage front-end dependencies.
- [Java 8+](https://www.java.com/ES/download/) - To generate JavaScript API client by OpenAPI specification.
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/alpine316.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine3.16 as builder
FROM golang:1.21-alpine3.16 as builder

RUN apk add --no-cache \
make \
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/centos7.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN yum -y groupinstall "Development Tools"
# Install golang.
ENV PATH /usr/local/go/bin:$PATH
RUN export ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
export GO_VERSION=1.19.5 && \
export GO_VERSION=1.21.12 && \
curl -OL https://golang.org/dl/go$GO_VERSION.linux-$ARCH.tar.gz && \
tar -C /usr/local/ -xzf go$GO_VERSION.linux-$ARCH.tar.gz && \
rm -f go$GO_VERSION.linux-$ARCH.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/pingcap/tidb-dashboard

go 1.18
go 1.21

require (
github.com/DATA-DOG/go-sqlmock v1.5.0
Expand Down
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisenkom/go-mssqldb v0.11.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/denisenkom/go-mssqldb v0.12.0 h1:VtrkII767ttSPNRfFekePK3sctr+joXgO58stqQbtUA=
github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4 h1:qk/FSDDxo05wdJH28W+p5yivv7LuLYLRXPPD8KQCtZs=
Expand Down Expand Up @@ -116,6 +117,7 @@ github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyr
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
Expand Down Expand Up @@ -145,7 +147,9 @@ github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfE
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA=
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
Expand Down Expand Up @@ -200,6 +204,7 @@ github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW
github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s=
github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI=
github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys=
github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI=
github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=
github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8=
github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE=
Expand All @@ -213,20 +218,24 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvW
github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM=
github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y=
github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA=
github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg=
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg=
github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
github.com/jackc/pgtype v1.3.0/go.mod h1:b0JqxHvPmljG+HQ5IsvQ0yqeSi4nGcDTVjFoiLDb0Ik=
github.com/jackc/pgtype v1.12.0 h1:Dlq8Qvcch7kiehm8wPGIW0W3KsCCHJnRacKW0UM8n5w=
github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o=
github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I=
github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
github.com/jackc/pgx/v4 v4.6.0/go.mod h1:vPh43ZzxijXUVJ+t/EmXBtFmbFVO72cuneCT9oAlxAg=
github.com/jackc/pgx/v4 v4.17.2 h1:0Ut0rpeKwvIVbMQ1KbMBU4h6wxehBI535LK6Flheh8E=
github.com/jackc/pgx/v4 v4.17.2/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw=
github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk=
Expand Down Expand Up @@ -306,6 +315,7 @@ github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/microsoft/go-mssqldb v0.17.0 h1:Fto83dMZPnYv1Zwx5vHHxpNraeEaUlQ/hhHLgZiaenE=
github.com/microsoft/go-mssqldb v0.17.0/go.mod h1:OkoNGhGEs8EZqchVTtochlXruEhEOaO4S0d2sB5aeGQ=
github.com/minio/sio v0.3.0 h1:syEFBewzOMOYVzSTFpp1MqpSZk8rUNbz8VIIc+PNzus=
github.com/minio/sio v0.3.0/go.mod h1:8b0yPp2avGThviy/+OCJBI6OMpvxoUuiLvE6F1lebhw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down Expand Up @@ -514,6 +524,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -655,9 +666,11 @@ gorm.io/datatypes v1.1.0/go.mod h1:SH2K9R+2RMjuX1CkCONrPwoe9JzVv2hkQvEu4bXGojE=
gorm.io/driver/mysql v1.4.5 h1:u1lytId4+o9dDaNcPCFzNv7h6wvmc92UjNk3z8enSBU=
gorm.io/driver/mysql v1.4.5/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc=
gorm.io/driver/postgres v1.4.5 h1:mTeXTTtHAgnS9PgmhN2YeUbazYpLhUI1doLnw42XUZc=
gorm.io/driver/postgres v1.4.5/go.mod h1:GKNQYSJ14qvWkvPwXljMGehpKrhlDNsqYRr5HnYGncg=
gorm.io/driver/sqlite v1.4.3 h1:HBBcZSDnWi5BW3B3rwvVTc510KGkBkexlOg0QrmLUuU=
gorm.io/driver/sqlite v1.4.3/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI=
gorm.io/driver/sqlserver v1.4.1 h1:t4r4r6Jam5E6ejqP7N82qAJIJAht27EGT41HyPfXRw0=
gorm.io/driver/sqlserver v1.4.1/go.mod h1:DJ4P+MeZbc5rvY58PnmN1Lnyvb5gw5NPzGshHDnJLig=
gorm.io/gorm v1.21.9/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0=
gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func newAPIHandlerEngine() (apiHandlerEngine *gin.Engine, endpoint *gin.RouterGr
return
}

var StoppedHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
var StoppedHandler = http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusNotFound)
_, _ = io.WriteString(w, "Dashboard is not started.\n")
})
16 changes: 8 additions & 8 deletions pkg/apiserver/conprof/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type NgMonitoringConfig struct {
// @Security JwtAuth
// @Failure 401 {object} rest.ErrorResponse
// @Failure 500 {object} rest.ErrorResponse
func (s *Service) ConprofConfig(c *gin.Context) {
func (s *Service) ConprofConfig(_ *gin.Context) {
// dummy, for generate openapi
}

Expand All @@ -98,7 +98,7 @@ func (s *Service) ConprofConfig(c *gin.Context) {
// @Success 200 {string} string "ok"
// @Failure 401 {object} rest.ErrorResponse
// @Failure 500 {object} rest.ErrorResponse
func (s *Service) UpdateConprofConfig(c *gin.Context) {
func (s *Service) UpdateConprofConfig(_ *gin.Context) {
// dummy, for generate openapi
}

Expand All @@ -115,7 +115,7 @@ type Component struct {
// @Security JwtAuth
// @Failure 401 {object} rest.ErrorResponse
// @Failure 500 {object} rest.ErrorResponse
func (s *Service) ConprofComponents(c *gin.Context) {
func (s *Service) ConprofComponents(_ *gin.Context) {
// dummy, for generate openapi
}

Expand All @@ -130,7 +130,7 @@ type EstimateSizeRes struct {
// @Success 200 {object} EstimateSizeRes
// @Failure 401 {object} rest.ErrorResponse
// @Failure 500 {object} rest.ErrorResponse
func (s *Service) EstimateSize(c *gin.Context) {
func (s *Service) EstimateSize(_ *gin.Context) {
// dummy, for generate openapi
}

Expand Down Expand Up @@ -180,7 +180,7 @@ type Target struct {
// @Success 200 {array} GroupProfiles
// @Failure 401 {object} rest.ErrorResponse
// @Failure 500 {object} rest.ErrorResponse
func (s *Service) ConprofGroupProfiles(c *gin.Context) {
func (s *Service) ConprofGroupProfiles(_ *gin.Context) {
// dummy, for generate openapi
}

Expand All @@ -191,7 +191,7 @@ func (s *Service) ConprofGroupProfiles(c *gin.Context) {
// @Success 200 {object} GroupProfileDetail
// @Failure 401 {object} rest.ErrorResponse
// @Failure 500 {object} rest.ErrorResponse
func (s *Service) ConprofGroupProfileDetail(c *gin.Context) {
func (s *Service) ConprofGroupProfileDetail(_ *gin.Context) {
// dummy, for generate openapi
}

Expand Down Expand Up @@ -219,7 +219,7 @@ func (s *Service) GenConprofActionToken(c *gin.Context) {
// @Produce application/x-gzip
// @Failure 401 {object} rest.ErrorResponse
// @Failure 500 {object} rest.ErrorResponse
func (s *Service) ConprofDownload(c *gin.Context) {
func (s *Service) ConprofDownload(_ *gin.Context) {
// dummy, for generate openapi
}

Expand Down Expand Up @@ -248,6 +248,6 @@ type ViewSingleProfileReq struct {
// @Produce html
// @Failure 401 {object} rest.ErrorResponse
// @Failure 500 {object} rest.ErrorResponse
func (s *Service) ConprofViewProfile(c *gin.Context) {
func (s *Service) ConprofViewProfile(_ *gin.Context) {
// dummy, for generate openapi
}
18 changes: 9 additions & 9 deletions pkg/apiserver/diagnose/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func GenerateReportError(errRows []TableRowDef) *TableDef {
}
}

func GetHeaderTimeTable(startTime, endTime string, db *gorm.DB) (TableDef, error) {
func GetHeaderTimeTable(startTime, endTime string, _ *gorm.DB) (TableDef, error) {
return TableDef{
Category: []string{CategoryHeader},
Title: "report_time_range",
Expand Down Expand Up @@ -716,7 +716,7 @@ func GetTiDBDDLOwner(startTime, endTime string, db *gorm.DB) (TableDef, error) {
return table, nil
}

func GetPDConfigInfo(startTime, endTime string, db *gorm.DB) (TableDef, error) {
func GetPDConfigInfo(startTime, _ string, db *gorm.DB) (TableDef, error) {
table := TableDef{
Category: []string{CategoryConfig},
Title: "scheduler_initial_config",
Expand Down Expand Up @@ -761,7 +761,7 @@ func GetPDConfigChangeInfo(startTime, endTime string, db *gorm.DB) (TableDef, er
return table, nil
}

func GetTiDBGCConfigInfo(startTime, endTime string, db *gorm.DB) (TableDef, error) {
func GetTiDBGCConfigInfo(startTime, _ string, db *gorm.DB) (TableDef, error) {
table := TableDef{
Category: []string{CategoryConfig},
Title: "tidb_gc_initial_config",
Expand Down Expand Up @@ -804,7 +804,7 @@ func GetTiDBGCConfigChangeInfo(startTime, endTime string, db *gorm.DB) (TableDef
return table, nil
}

func GetTiKVRocksDBConfigInfo(startTime, endTime string, db *gorm.DB) (TableDef, error) {
func GetTiKVRocksDBConfigInfo(startTime, _ string, db *gorm.DB) (TableDef, error) {
table := TableDef{
Category: []string{CategoryConfig},
Title: "tikv_rocksdb_initial_config",
Expand Down Expand Up @@ -885,7 +885,7 @@ func GetTiKVRocksDBConfigChangeInfo(startTime, endTime string, db *gorm.DB) (Tab
return table, nil
}

func GetTiKVRaftStoreConfigInfo(startTime, endTime string, db *gorm.DB) (TableDef, error) {
func GetTiKVRaftStoreConfigInfo(startTime, _ string, db *gorm.DB) (TableDef, error) {
table := TableDef{
Category: []string{CategoryConfig},
Title: "tikv_raftstore_initial_config",
Expand Down Expand Up @@ -1479,7 +1479,7 @@ func GetTiKVErrorTable(startTime, endTime string, db *gorm.DB) (TableDef, error)
return table, nil
}

func GetTiDBCurrentConfig(startTime, endTime string, db *gorm.DB) (TableDef, error) {
func GetTiDBCurrentConfig(_, _ string, db *gorm.DB) (TableDef, error) {
sql := "select `key`,`value` from information_schema.CLUSTER_CONFIG where type='tidb' group by `key`,`value` order by `key`;"
table := TableDef{
Category: []string{CategoryConfig},
Expand All @@ -1495,7 +1495,7 @@ func GetTiDBCurrentConfig(startTime, endTime string, db *gorm.DB) (TableDef, err
return table, nil
}

func GetPDCurrentConfig(startTime, endTime string, db *gorm.DB) (TableDef, error) {
func GetPDCurrentConfig(_, _ string, db *gorm.DB) (TableDef, error) {
sql := "select `key`,`value` from information_schema.CLUSTER_CONFIG where type='pd' group by `key`,`value` order by `key`;"
table := TableDef{
Category: []string{CategoryConfig},
Expand All @@ -1511,7 +1511,7 @@ func GetPDCurrentConfig(startTime, endTime string, db *gorm.DB) (TableDef, error
return table, nil
}

func GetTiKVCurrentConfig(startTime, endTime string, db *gorm.DB) (TableDef, error) {
func GetTiKVCurrentConfig(_, _ string, db *gorm.DB) (TableDef, error) {
sql := "select `key`,`value` from information_schema.CLUSTER_CONFIG where type='tikv' group by `key`,`value` order by `key`;"
table := TableDef{
Category: []string{CategoryConfig},
Expand Down Expand Up @@ -2038,7 +2038,7 @@ func GetPDEtcdStatusTable(startTime, endTime string, db *gorm.DB) (TableDef, err
return table, nil
}

func GetClusterInfoTable(startTime, endTime string, db *gorm.DB) (TableDef, error) {
func GetClusterInfoTable(_, _ string, db *gorm.DB) (TableDef, error) {
sql := "select * from information_schema.cluster_info order by type,start_time desc"
table := TableDef{
Category: []string{CategoryHeader},
Expand Down
Loading

0 comments on commit 0941ad4

Please sign in to comment.