https://github.com/itcomusic/protowrap
Helpers functions wrapperspb
https://github.com/itcomusic/protowrap
go golang pointer proto protobuf wrapperspb
Last synced: 7 months ago
JSON representation
Helpers functions wrapperspb
- Host: GitHub
- URL: https://github.com/itcomusic/protowrap
- Owner: itcomusic
- License: mit
- Created: 2022-07-12T12:31:09.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-20T14:12:55.000Z (about 3 years ago)
- Last Synced: 2024-06-21T03:17:00.772Z (over 1 year ago)
- Topics: go, golang, pointer, proto, protobuf, wrapperspb
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Protobuf wrapperspb helpers
[![pkg-img]][pkg-url]
[![coverage-img]][coverage-url]Provides helpers functions converting [wrapperspb](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb)
## Installation
Go version 1.18+
```bash
go get github.com/itcomusic/protowrap
```## Usage
```go
package mainimport (
"fmt""google.golang.org/protobuf/types/known/wrapperspb"
"github.com/itcomusic/protowrap"
)func main() {
i := protowrap.IntF32V[int](&wrapperspb.Int32Value{Value: 1})
fmt.Println(*i) // 1ints := protowrap.Ints[int]([]int32{1, 2, 3})
fmt.Println(ints) // [1, 2, 3]wi32 := protowrap.Int32Value(i)
fmt.Println(wi32) // value:1
}
```[pkg-img]: https://pkg.go.dev/badge/github.com/itcomusic/protowrap.svg
[pkg-url]: https://pkg.go.dev/github.com/itcomusic/protowrap
[coverage-img]: https://codecov.io/gh/itcomusic/protowrap/branch/main/graph/badge.svg
[coverage-url]: https://codecov.io/gh/itcomusic/protowrap