Compare commits
No commits in common. "db88502414c949f6194654ae0c8b4fe4990229eb" and "e785ce2860e5259b16000540a477276ec2813d23" have entirely different histories.
db88502414
...
e785ce2860
|
@ -1,5 +1,3 @@
|
||||||
// Package conf provides a configuration file parser for JOJ3.
|
|
||||||
// The configuration file path is determined by the commit message.
|
|
||||||
package conf
|
package conf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
1
cmd/joj3/env/env.go
vendored
1
cmd/joj3/env/env.go
vendored
|
@ -1,4 +1,3 @@
|
||||||
// Package env stores the environment variables from actions environment.
|
|
||||||
package env
|
package env
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// Referenced from https://github.com/yuriisk/clang-tidy-converter/blob/master/clang_tidy_converter/parser/clang_tidy_parser.py
|
||||||
package clangtidy
|
package clangtidy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -5,7 +6,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Referenced from https://github.com/yuriisk/clang-tidy-converter/blob/master/clang_tidy_converter/parser/clang_tidy_parser.py
|
|
||||||
type JsonMessage struct {
|
type JsonMessage struct {
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
CheckName string `json:"checkname"`
|
CheckName string `json:"checkname"`
|
||||||
|
|
19
pkg/util/map.go
Normal file
19
pkg/util/map.go
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
package utils
|
||||||
|
|
||||||
|
import "sort"
|
||||||
|
|
||||||
|
type Pair[K comparable, V any] struct {
|
||||||
|
Key K
|
||||||
|
Value V
|
||||||
|
}
|
||||||
|
|
||||||
|
func SortMap[K comparable, V any](m map[K]V, less func(i, j Pair[K, V]) bool) []Pair[K, V] {
|
||||||
|
pairs := make([]Pair[K, V], 0, len(m))
|
||||||
|
for k, v := range m {
|
||||||
|
pairs = append(pairs, Pair[K, V]{k, v})
|
||||||
|
}
|
||||||
|
sort.Slice(pairs, func(i, j int) bool {
|
||||||
|
return less(pairs[i], pairs[j])
|
||||||
|
})
|
||||||
|
return pairs
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user