Skip to content

Commit 37a5963

Browse files
committed
perf👌: Optimize go warnings
1 parent 69df1b3 commit 37a5963

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+83
-87
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ Describe changes from the user side, and list all potential break changes or oth
6262

6363
- [ ] Doc is updated/provided or not needed
6464
- [ ] Demo is updated/provided or not needed
65-
- [ ] TypeScript definition is updated/provided or not needed
65+
- [ ] TypeScript's definition is updated/provided or not needed
6666
- [ ] Changelog is provided or not needed

.github/workflows/issue-labeled.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
token: ${{ secrets.ADMIN_TOKEN }}
4747
issue-number: ${{ github.event.issue.number }}
4848
body: |
49-
Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please [don't ask usage questions](https://github.com/ant-design/ant-design/issues/2320) here. You can try to open a new discussion in [antd discussions](https://github.com/ant-design/ant-design/discussions), select `Q&A` to ask questions, also can ask questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) or [Segment Fault](https://segmentfault.com/t/antd), then apply tag `antd` and `react` to your question.
50-
你好 @${{ github.event.issue.user.login }},go-admin Issue 板块是用于 bug 反馈与需求讨论的地方。请[勿询问如何使用的问题](https://github.com/go-admin-te/ant-design/issues/699),你可以试着在 [antd discussions](https://github.com/ant-design/ant-design/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问,也可以在 [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) 或者 [Segment Fault](https://segmentfault.com/t/antd) 中提问(记得添加 `antd` 和 `react` 标签哦~)。
49+
Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please [don't ask usage questions](https://github.com/ant-design/ant-design/issues/2320) here. You can try to open a new discussion in [antd discussions](https://github.com/ant-design/ant-design/discussions), select `Q&A` to ask questions, also can ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/antd) or [Segment Fault](https://segmentfault.com/t/antd), then apply tag `antd` and `react` to your question.
50+
你好 @${{ github.event.issue.user.login }},go-admin Issue 板块是用于 bug 反馈与需求讨论的地方。请[勿询问如何使用的问题](https://github.com/go-admin-te/ant-design/issues/699),你可以试着在 [antd discussions](https://github.com/ant-design/ant-design/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问,也可以在 [Stack Overflow](https://stackoverflow.com/questions/tagged/antd) 或者 [Segment Fault](https://segmentfault.com/t/antd) 中提问(记得添加 `antd` 和 `react` 标签哦~)。
5151
- name: 3.x
5252
if: github.event.label.name == '3.x'
5353
uses: actions-cool/issues-helper@v3

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ config/settings.dev.yml.log
1717
config/settings.b.dev.yml
1818
cmd/migrate/migration/version-local/*
1919
!cmd/migrate/migration/version-local/doc.go
20-
*/.DS_Store
2120

2221
# go sum
2322
go.sum

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ vi ./config/settings.yml
158158
# 2. Confirm the log path
159159
```
160160

161-
:::tip ⚠️Note that this problem will occur if CGO is not installed in the windows environment;
161+
:::tip ⚠️Note that this problem will occur if CGO is not installed in the windows10+ environment;
162162

163163
```bash
164164
E:\go-admin>go build

app/admin/apis/go_admin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ body{
1717
overflow-y:hidden
1818
}
1919
</style>
20-
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
20+
<script src="https://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
2121
<script type="text/javascript">
2222
window.onerror=function(){return true;}
2323
$(function(){

app/admin/models/casbin_rule.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package models
22

3-
//sys_casbin_rule
43
type CasbinRule struct {
54
ID uint `gorm:"primaryKey;autoIncrement"`
65
Ptype string `gorm:"size:512;uniqueIndex:unique_index"`

app/admin/models/initdb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func ExecSql(db *gorm.DB, filePath string) error {
3131
fmt.Println(sqlList[i])
3232
continue
3333
}
34-
sql := strings.Replace(sqlList[i]+";", "\n", "", 0)
34+
sql := strings.Replace(sqlList[i]+";", "\n", "", -1)
3535
sql = strings.TrimSpace(sql)
3636
if err = db.Exec(sql).Error; err != nil {
3737
log.Printf("error sql: %s", sql)

app/admin/models/sys_api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type SysApi struct {
2727
models.ControlBy
2828
}
2929

30-
func (SysApi) TableName() string {
30+
func (*SysApi) TableName() string {
3131
return "sys_api"
3232
}
3333

@@ -44,14 +44,14 @@ func SaveSysApi(message storage.Messager) (err error) {
4444
var rb []byte
4545
rb, err = json.Marshal(message.GetValues())
4646
if err != nil {
47-
fmt.Errorf("json Marshal error, %s", err.Error())
47+
err = fmt.Errorf("json Marshal error, %v", err.Error())
4848
return err
4949
}
5050

5151
var l runtime.Routers
5252
err = json.Unmarshal(rb, &l)
5353
if err != nil {
54-
fmt.Errorf("json Unmarshal error, %s", err.Error())
54+
err = fmt.Errorf("json Unmarshal error, %s", err.Error())
5555
return err
5656
}
5757
dbList := sdk.Runtime.GetDb()

app/admin/models/sys_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type SysConfig struct {
1616
models.ModelTime
1717
}
1818

19-
func (SysConfig) TableName() string {
19+
func (*SysConfig) TableName() string {
2020
return "sys_config"
2121
}
2222

app/admin/models/sys_dept.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type SysDept struct {
77
ParentId int `json:"parentId" gorm:""` //上级部门
88
DeptPath string `json:"deptPath" gorm:"size:255;"` //
99
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
10-
Sort int `json:"sort" gorm:"size:4;"` //排序
10+
Sort int `json:"sort" gorm:"size:4;"` //排序
1111
Leader string `json:"leader" gorm:"size:128;"` //负责人
1212
Phone string `json:"phone" gorm:"size:11;"` //手机
1313
Email string `json:"email" gorm:"size:64;"` //邮箱
@@ -19,7 +19,7 @@ type SysDept struct {
1919
Children []SysDept `json:"children" gorm:"-"`
2020
}
2121

22-
func (SysDept) TableName() string {
22+
func (*SysDept) TableName() string {
2323
return "sys_dept"
2424
}
2525

0 commit comments

Comments
 (0)