• Home
  • Raw
  • Download

Lines Matching +full:go +full:- +full:version

1 # Go support for Protocol Buffers
3 [![Go Reference](https://pkg.go.dev/badge/google.golang.org/protobuf.svg)](https://pkg.go.dev/googl…
4 …d Status](https://travis-ci.org/protocolbuffers/protobuf-go.svg?branch=master)](https://travis-ci.…
6 This project hosts the Go implementation for
8 language-neutral, platform-neutral, extensible mechanism for serializing
11 bindings. This project provides both a tool to generate Go code for the
13 serialization of messages in Go. See the
20 [`protoc-gen-go`](https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go)
23 …[generate Go specific code for a given `.proto` file](https://protobuf.dev/reference/go/go-generat…
26 [`protobuf`](https://pkg.go.dev/mod/google.golang.org/protobuf) module
27 contains a set of Go packages that form the runtime implementation of
28 protobufs in Go. This provides the set of interfaces that
29 [define what a message is](https://pkg.go.dev/google.golang.org/protobuf/reflect/protoreflect)
31 [wire](https://pkg.go.dev/google.golang.org/protobuf/proto),
32 [JSON](https://pkg.go.dev/google.golang.org/protobuf/encoding/protojson),
34 [text](https://pkg.go.dev/google.golang.org/protobuf/encoding/prototext)).
37 [developer guide for protocol buffers in Go](https://protobuf.dev/getting-started/gotutorial)
38 for a general guide for how to get started using protobufs in Go.
40 This project is the second major revision of the Go protocol buffer API
42 [`google.golang.org/protobuf`](https://pkg.go.dev/mod/google.golang.org/protobuf)
43 module. The first major version is implemented by the
44 [`github.com/golang/protobuf`](https://pkg.go.dev/mod/github.com/golang/protobuf)
51 * [`proto`](https://pkg.go.dev/google.golang.org/protobuf/proto): Package
54 * [`encoding/protojson`](https://pkg.go.dev/google.golang.org/protobuf/encoding/protojson):
56 * [`encoding/prototext`](https://pkg.go.dev/google.golang.org/protobuf/encoding/prototext):
58 * [`encoding/protowire`](https://pkg.go.dev/google.golang.org/protobuf/encoding/protowire):
59 Package `protowire` parses and formats the low-level raw wire encoding. Most
61 * [`reflect/protoreflect`](https://pkg.go.dev/google.golang.org/protobuf/reflect/protoreflect):
64 * [`reflect/protoregistry`](https://pkg.go.dev/google.golang.org/protobuf/reflect/protoregistry):
67 * [`reflect/protodesc`](https://pkg.go.dev/google.golang.org/protobuf/reflect/protodesc):
71 * [`reflect/protopath`](https://pkg.go.dev/google.golang.org/protobuf/reflect/protopath):
74 * [`reflect/protorange`](https://pkg.go.dev/google.golang.org/protobuf/reflect/protorange):
76 * [`testing/protocmp`](https://pkg.go.dev/google.golang.org/protobuf/testing/protocmp):
78 * [`testing/protopack`](https://pkg.go.dev/google.golang.org/protobuf/testing/protopack):
80 * [`testing/prototest`](https://pkg.go.dev/google.golang.org/protobuf/testing/prototest):
83 * [`types/dynamicpb`](https://pkg.go.dev/google.golang.org/protobuf/types/dynamicpb):
86 * [`types/known/anypb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/anypb):
88 * [`types/known/timestamppb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/timestamp…
91 * [`types/known/durationpb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/durationpb…
94 * [`types/known/wrapperspb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb…
97 * [`types/known/structpb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/structpb):
100 * [`types/known/fieldmaskpb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/fieldmask…
103 * [`types/known/apipb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/apipb):
106 * [`types/known/typepb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/typepb):
109 * [`types/known/sourcecontextpb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/sourc…
112 * [`types/known/emptypb`](https://pkg.go.dev/google.golang.org/protobuf/types/known/emptypb):
115 * [`types/descriptorpb`](https://pkg.go.dev/google.golang.org/protobuf/types/descriptorpb):
118 * [`types/pluginpb`](https://pkg.go.dev/google.golang.org/protobuf/types/pluginpb):
121 * [`compiler/protogen`](https://pkg.go.dev/google.golang.org/protobuf/compiler/protogen):
123 * [`cmd/protoc-gen-go`](https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go):
124 The `protoc-gen-go` binary is a protoc plugin to generate a Go protocol
136 the version of the
137 [Go protocol buffer module](https://github.com/protocolbuffers/protobuf-go/releases)
138 and also the version of the
144 This project is open-source and accepts contributions. See the
145 [contribution guide](https://github.com/protocolbuffers/protobuf-go/blob/master/CONTRIBUTING.md)
168 generated Go packages of `.proto` files. This includes declared constants,
171 by `protoc-gen-go`. Such practice is not supported by this project.
174 …[`protoc-gen-go/internal_gengo`](https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go/i…
176 [`runtime/protoimpl`](https://pkg.go.dev/google.golang.org/protobuf/runtime/protoimpl?tab=doc)
178 [`internal`](https://pkg.go.dev/google.golang.org/protobuf/internal).
183 Users should use generated code produced by a version of
184 [`protoc-gen-go`](https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go)
185 that is identical to the runtime version provided by the
186 [protobuf module](https://pkg.go.dev/mod/google.golang.org/protobuf). This
188 version of the generator that is no older than 1 year from the version of the
189 runtime used, according to the release dates of the minor version. Generated
190 code is expected to use a runtime version that is at least as new as the
192 [`protoimpl.EnforceVersion`](https://pkg.go.dev/google.golang.org/protobuf/runtime/protoimpl?tab=do…
199 ([released in 2020](https://blog.golang.org/a-new-go-api-for-protocol-buffers))
200 of the Go protocol buffer API implemented by the
201 [`google.golang.org/protobuf`](https://pkg.go.dev/mod/google.golang.org/protobuf)
202 module. The first major version
203 ([released publicly in 2010](https://blog.golang.org/third-party-libraries-goprotobuf-and))
205 [`github.com/golang/protobuf`](https://pkg.go.dev/mod/github.com/golang/protobuf)
208 The first version predates the release of Go 1 by several years. It has a long
210 in Go. As such, the Go protobuf project was one of many pioneers for determining
211 what the Go language should even look like and what would eventually be
212 considered good design patterns and “idiomatic” Go (by simultaneously being
216 of Go language and library evolution throughout the life of this project:
218 ```go
219 // 2007/09/25 - Conception of Go
245 // 2012/03/28 - Release of Go 1
255 The change on June 6th, 2012 added a degree of type-safety to Go protobufs by
258 ```go
267 from the universal set of all possible Go types to those with a special
270 For example, there is no sensible operation if a Go channel were passed to the
276 a Go struct with a specific layout of fields with formatted tags. This
277 expectation is not statically enforced by the Go language, for it is an
278 implementation detail checked dynamically at runtime using Go reflection. Back
280 `protoc-gen-go`. Since `protoc-gen-go` would always generate messages with the
285 [use of Go would skyrocket](https://blog.golang.org/10years) and use of
286 protobufs in Go would skyrocket as well. With increased popularity also came
287 more diverse usages and requirements for Go protobufs and an increased number of
289 `protoc-gen-go`.
291 The increasingly diverse ecosystem of Go types implementing the `proto.Message`
295 message implementation might work with some top-level functions (e.g.,
302 * **Using Go reflection on any `proto.Message` types**: A common desire is to
303 write general-purpose code that operates on any protobuf message. For
305 present in a message. To accomplish this, one would use Go reflection to
306 introspect the message type, and assume it were a pointer to a Go struct
308 `protoc-gen-go`). If the concrete message type did not match this
310 the case for concrete message types that might be backed by a Go map instead
311 of a Go struct.
317 This feature is called _protobuf reflection_. Just as how Go reflection provides
318 an API for programmatically interacting with any arbitrary Go value, protobuf
323 suggested the need for a new major version that defines a new `proto.Message`
326 ```go
333 [`proto.Message`](https://pkg.go.dev/google.golang.org/protobuf/proto?tab=doc#Message)
335 [`protoreflect.Message`](https://pkg.go.dev/google.golang.org/protobuf/reflect/protoreflect?tab=doc…
344 Go ecosystem well for the next 10 years and beyond.