You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
1.1 KiB

  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 pragma provides types that can be embedded into a struct to
  5. // statically enforce or prevent certain language properties.
  6. package pragma
  7. import "sync"
  8. // NoUnkeyedLiterals can be embedded in a struct to prevent unkeyed literals.
  9. type NoUnkeyedLiterals struct{}
  10. // DoNotImplement can be embedded in an interface to prevent trivial
  11. // implementations of the interface.
  12. //
  13. // This is useful to prevent unauthorized implementations of an interface
  14. // so that it can be extended in the future for any protobuf language changes.
  15. type DoNotImplement interface{ ProtoInternal(DoNotImplement) }
  16. // DoNotCompare can be embedded in a struct to prevent comparability.
  17. type DoNotCompare [0]func()
  18. // DoNotCopy can be embedded in a struct to help prevent shallow copies.
  19. // This does not rely on a Go language feature, but rather a special case
  20. // within the vet checker.
  21. //
  22. // See https://golang.org/issues/8005.
  23. type DoNotCopy [0]sync.Mutex