mirror of
https://github.com/kovetskiy/mark.git
synced 2026-05-01 12:42:36 +00:00
refactor: modernize Go primitives
- Replace interface{} with any (Go 1.18) across confluence/api.go,
macro/macro.go, util/cli.go, util/error_handler.go, includes/templates.go
- Replace sort.SliceStable with slices.SortStableFunc + cmp.Compare (Go 1.21)
in attachment/attachment.go, consistent with existing slices usage
- Replace fmt.Errorf("%s", msg) with errors.New(msg) in mark.go
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
10
util/cli.go
10
util/cli.go
@@ -23,7 +23,7 @@ func RunMark(ctx context.Context, cmd *cli.Command) error {
|
||||
output := zerolog.ConsoleWriter{
|
||||
Out: os.Stderr,
|
||||
TimeFormat: "2006-01-02 15:04:05.000",
|
||||
FormatLevel: func(i interface{}) string {
|
||||
FormatLevel: func(i any) string {
|
||||
var l string
|
||||
if ll, ok := i.(string); ok {
|
||||
switch ll {
|
||||
@@ -49,16 +49,16 @@ func RunMark(ctx context.Context, cmd *cli.Command) error {
|
||||
}
|
||||
return l
|
||||
},
|
||||
FormatFieldName: func(i interface{}) string {
|
||||
FormatFieldName: func(i any) string {
|
||||
return ""
|
||||
},
|
||||
FormatFieldValue: func(i interface{}) string {
|
||||
FormatFieldValue: func(i any) string {
|
||||
return fmt.Sprintf("%s", i)
|
||||
},
|
||||
FormatErrFieldName: func(i interface{}) string {
|
||||
FormatErrFieldName: func(i any) string {
|
||||
return ""
|
||||
},
|
||||
FormatErrFieldValue: func(i interface{}) string {
|
||||
FormatErrFieldValue: func(i any) string {
|
||||
return fmt.Sprintf("%s", i)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user