File: plumbing.go

package info (click to toggle)
golang-github-bodgit-plumbing 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 152 kB
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 374 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Package plumbing is a collection of assorted I/O helpers.
package plumbing

import "io"

type nopWriteCloser struct {
	io.Writer
}

func (nopWriteCloser) Close() error {
	return nil
}

// NopWriteCloser returns an io.WriteCloser with a no-op Close method
// wrapping the provided io.Writer w.
func NopWriteCloser(w io.Writer) io.WriteCloser {
	return nopWriteCloser{w}
}