impl.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Package protoimpl contains the default implementation for messages
  5. // generated by protoc-gen-go.
  6. //
  7. // WARNING: This package should only ever be imported by generated messages.
  8. // The compatibility agreement covers nothing except for functionality needed
  9. // to keep existing generated messages operational. Breakages that occur due
  10. // to unauthorized usages of this package are not the author's responsibility.
  11. package protoimpl
  12. import "github.com/golang/protobuf/v2/internal/impl"
  13. // Version is the current minor version of the package.
  14. // This is incremented every time the API of this package expands.
  15. const Version = 0 // v2.{Version}.x
  16. var X impl.Export
  17. type (
  18. // EnforceVersion is used by code generated by protoc-gen-go
  19. // to statically enforce a minimum version of this package.
  20. // A compilation failure implies that this package is too old and
  21. // needs to be updated to a more recent version.
  22. //
  23. // This package can be upgraded by running:
  24. // go get -u github.com/golang/protobuf/v2/...
  25. //
  26. // Example usage by generated code:
  27. // const _ = protoimpl.EnforceVersion(protoimpl.Version - genVersion)
  28. //
  29. // If genVersion is lower than Version, then this results in a negative
  30. // integer overflow failure when evaluating the uint constant.
  31. EnforceVersion uint
  32. MessageType = impl.MessageType
  33. )