Skip to content

Commit

Permalink
fix: update result
Browse files Browse the repository at this point in the history
  • Loading branch information
kooksee committed Jan 17, 2024
1 parent dd828de commit cea7e16
Show file tree
Hide file tree
Showing 21 changed files with 203 additions and 314 deletions.
2 changes: 1 addition & 1 deletion errors/aaa.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package errors

import (
"fmt"
"google.golang.org/grpc/status"

json "github.com/goccy/go-json"
"google.golang.org/grpc/status"
)

var _ json.Marshaler = (Tags)(nil)
Expand Down
12 changes: 6 additions & 6 deletions errors/err_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"fmt"
json "github.com/goccy/go-json"
"github.com/pubgo/funk/errors/internal"
"github.com/pubgo/funk/errors/errinter"
"github.com/pubgo/funk/generic"
"github.com/pubgo/funk/proto/errorpb"
"github.com/pubgo/funk/stack"
Expand Down Expand Up @@ -73,11 +73,11 @@ func (t *ErrCode) Format(f fmt.State, verb rune) { strFormat(f, verb, t) }

func (t *ErrCode) String() string {
var buf = bytes.NewBuffer(nil)
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorKind, t.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %d\n", internal.ColorCode, t.pb.Code))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorMessage, t.pb.Message))
buf.WriteString(fmt.Sprintf("%s]: %s\n", internal.ColorName, t.pb.Name))
buf.WriteString(fmt.Sprintf("%s]: %s\n", internal.ColorStatusCode, t.pb.StatusCode.String()))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorKind, t.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %d\n", errinter.ColorCode, t.pb.Code))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorMessage, t.pb.Message))
buf.WriteString(fmt.Sprintf("%s]: %s\n", errinter.ColorName, t.pb.Name))
buf.WriteString(fmt.Sprintf("%s]: %s\n", errinter.ColorStatusCode, t.pb.StatusCode.String()))
errStringify(buf, t.err)
return buf.String()
}
Expand Down
12 changes: 6 additions & 6 deletions errors/err_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"

json "github.com/goccy/go-json"
"github.com/pubgo/funk/errors/internal"
"github.com/pubgo/funk/errors/errinter"
"github.com/pubgo/funk/generic"
"github.com/pubgo/funk/proto/errorpb"
"github.com/pubgo/funk/stack"
Expand Down Expand Up @@ -54,11 +54,11 @@ func (t *ErrMsg) Format(f fmt.State, verb rune) { strFormat(f, verb, t) }

func (t *ErrMsg) String() string {
var buf = bytes.NewBuffer(nil)
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorKind, t.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorMsg, t.pb.Msg))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorDetail, t.pb.Detail))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorStack, t.pb.Stack))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorTags, t.pb.Tags))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorKind, t.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorMsg, t.pb.Msg))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorDetail, t.pb.Detail))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorStack, t.pb.Stack))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorTags, t.pb.Tags))
errStringify(buf, t.err)
return buf.String()
}
Expand Down
49 changes: 0 additions & 49 deletions errors/err_redirect.go

This file was deleted.

10 changes: 5 additions & 5 deletions errors/err_simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

json "github.com/goccy/go-json"

"github.com/pubgo/funk/errors/internal"
"github.com/pubgo/funk/errors/errinter"
)

var _ fmt.Formatter = (*Err)(nil)
Expand All @@ -33,11 +33,11 @@ func (e Err) MarshalJSON() ([]byte, error) {

func (e Err) String() string {
var buf = bytes.NewBuffer(nil)
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorKind, e.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorMsg, e.Msg))
buf.WriteString(fmt.Sprintf("%s]: %s\n", internal.ColorDetail, e.Detail))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorKind, e.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorMsg, e.Msg))
buf.WriteString(fmt.Sprintf("%s]: %s\n", errinter.ColorDetail, e.Detail))
for i := range e.Tags {
buf.WriteString(fmt.Sprintf("%s]: %s\n", internal.ColorTags, e.Tags[i].String()))
buf.WriteString(fmt.Sprintf("%s]: %s\n", errinter.ColorTags, e.Tags[i].String()))
}
return buf.String()
}
12 changes: 6 additions & 6 deletions errors/err_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"

json "github.com/goccy/go-json"
"github.com/pubgo/funk/errors/internal"
"github.com/pubgo/funk/errors/errinter"
"github.com/pubgo/funk/generic"
"github.com/pubgo/funk/proto/errorpb"
"github.com/pubgo/funk/stack"
Expand Down Expand Up @@ -54,11 +54,11 @@ func (t *ErrTrace) Format(f fmt.State, verb rune) { strFormat(f, verb, t) }

func (t *ErrTrace) String() string {
var buf = bytes.NewBuffer(nil)
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorKind, t.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorId, t.pb.Id))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorOperation, t.pb.Operation))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorService, t.pb.Service))
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorVersion, t.pb.Version))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorKind, t.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorId, t.pb.Id))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorOperation, t.pb.Operation))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorService, t.pb.Service))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorVersion, t.pb.Version))
errStringify(buf, t.err)
return buf.String()
}
Expand Down
10 changes: 5 additions & 5 deletions errors/err_wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

jjson "github.com/goccy/go-json"

"github.com/pubgo/funk/errors/internal"
"github.com/pubgo/funk/errors/errinter"
"github.com/pubgo/funk/stack"
)

Expand All @@ -28,14 +28,14 @@ func (e *ErrWrap) Error() string { return e.err.Error() }
func (e *ErrWrap) String() string {
var buf = bytes.NewBuffer(nil)
buf.WriteString("===============================================================\n")
buf.WriteString(fmt.Sprintf("%s]: %q\n", internal.ColorKind, e.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %s\n", internal.ColorCaller, e.caller.String()))
buf.WriteString(fmt.Sprintf("%s]: %q\n", errinter.ColorKind, e.Kind()))
buf.WriteString(fmt.Sprintf("%s]: %s\n", errinter.ColorCaller, e.caller.String()))
for i := range e.fields {
buf.WriteString(fmt.Sprintf("%s]: %s\n", internal.ColorTags, e.fields[i].String()))
buf.WriteString(fmt.Sprintf("%s]: %s\n", errinter.ColorTags, e.fields[i].String()))
}

for i := range e.stack {
buf.WriteString(fmt.Sprintf("%s]: %s\n", internal.ColorStack, e.stack[i].String()))
buf.WriteString(fmt.Sprintf("%s]: %s\n", errinter.ColorStack, e.stack[i].String()))
}
errStringify(buf, e.err)
return buf.String()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package internal
package errinter

import (
"strings"
Expand Down
6 changes: 3 additions & 3 deletions errors/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/alecthomas/repr"

"github.com/pubgo/funk/convert"
"github.com/pubgo/funk/errors/internal"
"github.com/pubgo/funk/errors/errinter"
"github.com/pubgo/funk/generic"
"github.com/pubgo/funk/proto/errorpb"
"github.com/pubgo/funk/stack"
Expand Down Expand Up @@ -68,8 +68,8 @@ func errStringify(buf *bytes.Buffer, err error) {
return
}

buf.WriteString(fmt.Sprintf("%s]: %s\n", internal.ColorErrMsg, strings.TrimSpace(err.Error())))
buf.WriteString(fmt.Sprintf("%s]: %s\n", internal.ColorErrDetail, strings.TrimSpace(fmt.Sprintf("%v", err))))
buf.WriteString(fmt.Sprintf("%s]: %s\n", errinter.ColorErrMsg, strings.TrimSpace(err.Error())))
buf.WriteString(fmt.Sprintf("%s]: %s\n", errinter.ColorErrDetail, strings.TrimSpace(fmt.Sprintf("%v", err))))
err = Unwrap(err)
if err != nil {
errStringify(buf, err)
Expand Down
2 changes: 1 addition & 1 deletion proto/commonpb/page.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/commonpb/request-info.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/commonpb/resource.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/commonpb/response.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/errorpb/code.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cea7e16

Please sign in to comment.