nocopy.go 514 B

123456789101112131415
  1. package httpexpect
  2. // noCopy struct is a special type that is used to prevent a value from being copied.
  3. // `go vet` gives a warning if it finds that a struct with a field of
  4. // this type is being copied.
  5. // To enable this behavior, this struct provides two methods `Lock` and `Unlock,
  6. // that do not do anything.
  7. // See more details here:
  8. // https://github.com/golang/go/issues/8005
  9. // https://stackoverflow.com/questions/52494458
  10. type noCopy struct{}
  11. func (*noCopy) Lock() {}
  12. func (*noCopy) Unlock() {}