chore: fix lint errors (#6951)

pull/6964/head
Joe Chen 2022-05-16 20:57:19 +08:00 committed by GitHub
parent a6c53eb068
commit c4b770f305
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

@ -315,9 +315,7 @@ func (issue *Issue) clearLabels(e *xorm.Session) (err error) {
// NOTE: issue.removeLabel slices issue.Labels, so we need to create another slice to be unaffected.
labels := make([]*Label, len(issue.Labels))
for i := range issue.Labels {
labels[i] = issue.Labels[i]
}
copy(labels, issue.Labels)
for i := range labels {
if err = issue.removeLabel(e, labels[i]); err != nil {
return fmt.Errorf("removeLabel: %v", err)

View File

@ -99,11 +99,8 @@ func validate(errs binding.Errors, data map[string]interface{}, f Form, l macaro
Assign(f, data)
typ := reflect.TypeOf(f)
val := reflect.ValueOf(f)
if typ.Kind() == reflect.Ptr {
typ = typ.Elem()
val = val.Elem()
}
for i := 0; i < typ.NumField(); i++ {