aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/db/issue.go4
-rw-r--r--internal/form/form.go3
2 files changed, 1 insertions, 6 deletions
diff --git a/internal/db/issue.go b/internal/db/issue.go
index fdcabf9b..9fafd4f0 100644
--- a/internal/db/issue.go
+++ b/internal/db/issue.go
@@ -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)
diff --git a/internal/form/form.go b/internal/form/form.go
index db6e040b..bddbd128 100644
--- a/internal/form/form.go
+++ b/internal/form/form.go
@@ -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++ {