From d4f84f1c937e24e71aa5f05c58d440cde741450f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 31 Mar 2022 17:20:39 +0800 Subject: Move reaction to models/issues/ (#19264) * Move reaction to models/issues/ * Fix test * move the function * improve code * Update models/issues/reaction.go Co-authored-by: wxiaoguang Co-authored-by: wxiaoguang --- modules/container/map.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 modules/container/map.go (limited to 'modules/container') diff --git a/modules/container/map.go b/modules/container/map.go new file mode 100644 index 0000000000..3519de0951 --- /dev/null +++ b/modules/container/map.go @@ -0,0 +1,14 @@ +// Copyright 2022 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package container + +// KeysInt64 returns keys slice for a map with int64 key +func KeysInt64(m map[int64]struct{}) []int64 { + keys := make([]int64, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + return keys +} -- cgit v1.2.3