Compare commits

..

2 Commits

Author SHA1 Message Date
vtolstov
629087ec7e Apply Code Coverage Badge 2024-12-22 20:41:14 +00:00
c576abf26a Обновить README.md
Some checks failed
lint / lint (pull_request) Successful in 1m20s
test / test (pull_request) Successful in 1m57s
coverage / build (pull_request) Failing after 9m4s
Signed-off-by: Василий Толстов <v.tolstov@unistack.org>
2024-12-22 23:40:28 +03:00
5 changed files with 2 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
# Micro
![Coverage](https://img.shields.io/badge/Coverage-44.9%25-yellow)
![Coverage](https://img.shields.io/badge/Coverage-45.0%25-yellow)
Micro is a standard library for microservices.

View File

@@ -54,22 +54,3 @@ func (m *RawMessage) UnmarshalJSON(data []byte) error {
*m = append((*m)[0:0], data...)
return nil
}
// MarshalYAML returns m as the JSON encoding of m.
func (m *RawMessage) MarshalYAML() ([]byte, error) {
if m == nil {
return []byte("null"), nil
} else if len(*m) == 0 {
return []byte("null"), nil
}
return *m, nil
}
// UnmarshalYAML sets *m to a copy of data.
func (m *RawMessage) UnmarshalYAML(data []byte) error {
if m == nil {
return errors.New("RawMessage UnmarshalYAML on nil pointer")
}
*m = append((*m)[0:0], data...)
return nil
}

View File

@@ -20,16 +20,6 @@ func (m *Frame) UnmarshalJSON(data []byte) error {
return m.Unmarshal(data)
}
// MarshalYAML returns frame data
func (m *Frame) MarshalYAML() ([]byte, error) {
return m.Marshal()
}
// UnmarshalYAML set frame data
func (m *Frame) UnmarshalYAML(data []byte) error {
return m.Unmarshal(data)
}
// ProtoMessage noop func
func (m *Frame) ProtoMessage() {}

View File

@@ -8,7 +8,6 @@ import (
"time"
uuidv8 "github.com/ash3in/uuidv8"
"github.com/google/uuid"
nanoid "github.com/matoous/go-nanoid"
)
@@ -97,10 +96,6 @@ func New(opts ...Option) (string, error) {
return "", errors.New("invalid option, Type unspecified")
}
func ToUUID(s string) uuid.UUID {
return uuid.MustParse(s)
}
// Must is the same as New but fatals on error
func MustNew(opts ...Option) string {
id, err := New(opts...)

View File

@@ -7,14 +7,5 @@ func TestUUIDv8(t *testing.T) {
if err != nil {
t.Fatal(err)
}
_ = id
}
func TestToUUID(t *testing.T) {
id, err := New()
if err != nil {
t.Fatal(err)
}
u := ToUUID(id)
_ = u
t.Logf("xxx %s\n", id)
}