mirror of
https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git
synced 2024-11-17 07:28:12 +00:00
910ccdb092
Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.26.1 to 2.27.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.26.1...v2.27.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
3.4 KiB
3.4 KiB
MessagePack encoding for Golang
❤️ Uptrace.dev - All-in-one tool to optimize performance and monitor errors & logs
- Join Discord to ask questions.
- Documentation
- Reference
- Examples
Other projects you may like:
- Bun - fast and simple SQL client for PostgreSQL, MySQL, and SQLite.
- BunRouter - fast and flexible HTTP router for Go.
Features
- Primitives, arrays, maps, structs, time.Time and interface{}.
- Appengine *datastore.Key and datastore.Cursor.
- CustomEncoder/CustomDecoder interfaces for custom encoding.
- Extensions to encode type information.
- Renaming fields via
msgpack:"my_field_name"
and alias viamsgpack:"alias:another_name"
. - Omitting individual empty fields via
msgpack:",omitempty"
tag or all empty fields in a struct. - Map keys sorting.
- Encoding/decoding all structs as arrays or individual structs.
- Encoder.SetCustomStructTag with Decoder.SetCustomStructTag can turn msgpack into drop-in replacement for any tag.
- Simple but very fast and efficient queries.
Installation
msgpack supports 2 last Go versions and requires support for Go modules. So make sure to initialize a Go module:
go mod init github.com/my/repo
And then install msgpack/v5 (note v5 in the import; omitting it is a popular mistake):
go get github.com/vmihailenco/msgpack/v5
Quickstart
import "github.com/vmihailenco/msgpack/v5"
func ExampleMarshal() {
type Item struct {
Foo string
}
b, err := msgpack.Marshal(&Item{Foo: "bar"})
if err != nil {
panic(err)
}
var item Item
err = msgpack.Unmarshal(b, &item)
if err != nil {
panic(err)
}
fmt.Println(item.Foo)
// Output: bar
}