nocopy.go 426 B

1234567891011
  1. package fasthttp
  2. // Embed this type into a struct, which mustn't be copied,
  3. // so `go vet` gives a warning if this struct is copied.
  4. //
  5. // See https://github.com/golang/go/issues/8005#issuecomment-190753527 for details.
  6. // and also: https://stackoverflow.com/questions/52494458/nocopy-minimal-example
  7. type noCopy struct{} //nolint:unused
  8. func (*noCopy) Lock() {} //nolint:unused
  9. func (*noCopy) Unlock() {} //nolint:unused