From bf4426e35e6759ee708e2f7de8db1cf8dce6be14 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 31 Mar 2014 09:36:08 -0700 Subject: [PATCH] types: add EmptyBody Change-Id: Ic0cc6cae6debb20fbc15bd95692e8565171eae49 --- pkg/types/types.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/types/types.go b/pkg/types/types.go index f75b0d199..4b1f4c8d8 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -40,6 +40,10 @@ var ( // NopCloser is an io.Closer that does nothing. var NopCloser io.Closer = ioutil.NopCloser(nil) +// EmptyBody is a ReadCloser that returns EOF on Read and does nothing +// on Close. +var EmptyBody io.ReadCloser = ioutil.NopCloser(strings.NewReader("")) + // Time3339 is a time.Time which encodes to and from JSON // as an RFC 3339 time in UTC. type Time3339 time.Time