MCPcopy Index your code
hub / github.com/citilinkru/uuid-msgpack

github.com/citilinkru/uuid-msgpack @v1.0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.3 ↗ · + Follow
9 symbols 18 edges 3 files 0 documented · 0% updated 2y agov1.0.3 · 2023-02-19★ 74
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

UUID msgpack

Lint Tests codecov Go Report Card License GoDoc Release

Library to integrate github.com/google/uuid with gopkg.in/vmihailenco/msgpack

Installation

go get github.com/citilinkru/uuid-msgpack

Example

package main

import (
    _ "github.com/citilinkru/uuid-msgpack" // This blank import is required to register encoder/decoder!
    "github.com/google/uuid"
    "log"
    "bytes"
    "gopkg.in/vmihailenco/msgpack.v2" 
)

func main() {
    id := uuid.New()
    buf := bytes.NewBuffer(nil)
    encoder := msgpack.NewEncoder(buf)
    err := encoder.Encode(id)
    if err != nil {
        log.Fatalf("can't encode uuid: %s", err)
    }
    reader := bytes.NewReader(buf.Bytes())
    decoder := msgpack.NewDecoder(reader)
    var decodedId uuid.UUID
    err = decoder.Decode(&decodedId)
    if err != nil {
        log.Fatalf("can't decode uuid: %s", err)
    }

    if id.String() == decodedId.String() {
        log.Printf("original id is equal to decoded '%s'\n", id)
    } else {
        log.Printf("decoded id '%s' is not equal to origin '%s'\n", id, decodedId)
    }

    log.Println("done")
}

Testing

Unit-tests:

go test -v -race ./...

Run linter:

go mod vendor \
  && docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.40 golangci-lint run -v \
  && rm -R vendor

CONTRIBUTE

  • write code
  • run go fmt ./...
  • run all linters and tests (see above)
  • create a PR describing the changes

LICENSE

MIT

AUTHOR

Nikita Sapogov amstaffix@gmail.com

Core symbols most depended-on inside this repo

init
called by 0
uuid.go

Shape

Function 8
Struct 1

Languages

Go100%

Modules by API surface

uuid_test.go7 symbols
uuid.go1 symbols
example_test.go1 symbols

For agents

$ claude mcp add uuid-msgpack \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact